How to cancel image loading?

S

Sophy

Hi folks,

Now, I am facing problem with canceling image loading.
I have tried:

var img = new Image();
img.src = "path/to/the/image";

// and then I set the img.src to another source

img.src = "somewhere/else";

In this case the browse still loading the image from the first source
("path/to/the/image")

Do you guys know how to stop image from loading?

Cheers,
 
E

Evertjan.

Sophy wrote on 18 jul 2008 in comp.lang.javascript:
Now, I am facing problem with canceling image loading.
I have tried:

var img = new Image();
img.src = "path/to/the/image";

// and then I set the img.src to another source

img.src = "somewhere/else";

In this case the browse still loading the image from the first source
("path/to/the/image")

Do you guys know how to stop image from loading?

Not with clientside javascript.

You could force the browser to close by external means,
like pulling the plug??
 
S

Sophy

Sophy wrote on 18 jul 2008 in comp.lang.javascript:







Not with clientside javascript.

You could force the browser to close by external means,
like pulling the plug??

Can you tell me more about this(pulling and plug)?
 
E

Evertjan.

Sophy wrote on 18 jul 2008 in comp.lang.javascript:
On Jul 18, 3:04 pm, "Evertjan." wrote:

[still morning overhere

[please do not quote signatures on usenet,
and only quote relevant parts]
Can you tell me more about this(pulling and plug)?

Yes, look at the back of your computer,
There are many wires, one of them thicker than the others,
usually but not neccessarily black.
That one usually has a connector on both ends.
Disconnect one of those connectors.

Seems a bit off topic too, Sophy.
 
G

GArlington

Hi folks,

Now, I am facing problem with canceling image loading.
I have tried:

var img = new Image();
img.src = "path/to/the/image";

// and then I set the img.src to another source

img.src = "somewhere/else";

In this case the browse still loading the image from the first source
("path/to/the/image")

Do you guys know how to stop image from loading?

Cheers,

How about:
var img = new Image();
img.src = "path/to/the/image";
....
// Oh, shit I changed my mind for some reason
img = new Image();
img.src = "somewhere/else";
 
L

Laser Lips

Do you guys know how to stop image from loading?>

Don't specify a URL?
Seriously, your going to have to explain a bit more how and why your
doing this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
Sean29G025

Latest Threads

Top