26 January 2011

Stop loading of images on ajax call abort

Most of us know how to abort the jQuery Ajax call. But even jQuery ajax call is aborted still images are loading into my page. I want to cancel image loading if ajax callis aborted.

Here is the solution I got from stackoverflow

Add this to your ajax abort function

if (window.stop !== undefined) {
window.stop();
} else if (document.execCommand !== undefined) {
document.execCommand("Stop", false);
}

No comments: