Thomas 'PointedEars' Lahn said the following on 1/12/2006 7:41 PM:
Randy Webb wrote:
Providing nonsensical "solutions" such as this is not going to help
anyone.
I didn't offer it as a "solution". Call it a "proof of concept" as it
shows that you can indeed stop image loading via JS. Is it realistic? No.
But it can be done.
But then I doubt that was your intention; you are merely trolling here,
again.
I will take that as a compliment as it is coming from you. It is typical
of you that when you are wrong and get corrected and then proven wrong
that you call the person who corrected you a troll.
Yes, it was.
Yes, I did.
No, you did not. You talked about something that has a low probability
of
being helpful at all, and then you talked about something that is far too
less reliable to qualify as a solution to the OP's problem.
Again, it was not posted as a "solution", but as a "proof of concept" to
show you that you can indeed stop it. Once again, not realistic but
possible.
And *I* _proved_ *you* wrong, every time.
I suppose that if your definition of wrong is that you are right, then so
be it.
[...]
Or, loop through the images collection and set all src properties to
'';
and it will stop downloading them.
You cannot reliably access the DOM tree, including the document.images
collection, before the document has finished loading, so you cannot
reliably prevent the images from loading.
Put it at the end of the document, do not use the onload. [...]
Makes no difference. Most of the images will already be loaded by then.
Now, open a page with 200,000 image tags in it. Hit the STOP button on
the browser. [...]
Given your above comment about "most of the images will already be
loaded". Are you saying that your computer will download 200,000 images
before the browser reads the HTML file to the end?
The OP asked:
| Is there some way in JavaScript to stop the downloading of pictures
| from a web page?
It was not asked:
"Is there some way to prevent pictures of a web page from being
displayed?"
And I did not answer that question. I corrected your incorrect answer.
Even though it is not realistic to do what I said you *could* do, it is
still technically possible and that makes your answer *WRONG*.
HAND
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/