On Wed, Dec 22, 2010 at 3:52 AM, Amit Agarwal <[email protected]> wrote:
> Hi,
>
> How to abort an Image request which is still on the fly?
>
> Example:
>
> var img = new Image();
> var img.src = "http://www.google.co.in/images/nav_logo29.png";;
> window.setTimeout(function(){
>      //Code to abort/cancel image request if it hasn't triggered onload or
> onerror even after 20 seconds of sending request.
> },20000)

This works for me:

var img = new Image();
                img.src = "http://dummyimage.com/2600x2400/000/fff";;
                window.setTimeout(function(){
                         img.src = "about:blank";
                },1);

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to