470,612 Members | 2,506 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,612 developers. It's quick & easy.

Preload Images

Hello,

How can I preload a few images of a page javascript?
Should I use CSS to do this? Is it even possible?

Thanks,
Miguel
Nov 26 '07 #1
9 1830
shapper wrote:
Hello,

How can I preload a few images of a page javascript?
Hi,

Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.

Regards,
Erwin Moller
Should I use CSS to do this? Is it even possible?

Thanks,
Miguel
Nov 26 '07 #2
Erwin Moller wrote:
shapper wrote:
>How can I preload a few images of a page javascript?

[...]
Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.
However,

http://groups.google.com

and

preload images group:comp.lang.javascript

returns more useful information.
Please trim your quotes as described in the FAQ Notes.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Nov 26 '07 #3
Thomas 'PointedEars' Lahn wrote:
Erwin Moller wrote:
>shapper wrote:
>>How can I preload a few images of a page javascript?
[...]
Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.

However,

http://groups.google.com

and

preload images group:comp.lang.javascript

returns more useful information.
Good advise.
>

Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.

Regards,
Erwin Moller
>
PointedEars
Nov 27 '07 #4
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
Erwin Moller wrote:
>Thomas 'PointedEars' Lahn wrote:
>>Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.

It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.
You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 27 '07 #5
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
>Erwin Moller wrote:
>>Thomas 'PointedEars' Lahn wrote:
Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.
It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.

You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.
I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.

I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Nov 27 '07 #6
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:40 PM:
Randy Webb wrote:
>Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
>>Erwin Moller wrote:
Thomas 'PointedEars' Lahn wrote:
Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.
It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.
You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.

I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Then I find it necessary to point out that you have posted way more than
those two lines to complain about those two lines. If it had been enough
to have been worthwhile, then sure. But two lines? Wind down my friend.
I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
I said the FAQ content isn't important? Wow. You are pedantically
complaining about two lines. I quote a lot more than that, are you going
to start being pedantic with me as well?

Two lines crosses into a gray area where you have to apply some common
sense sometimes and realize it causes more problems to complain than the
two lines ever did.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 28 '07 #7
Thomas 'PointedEars' Lahn wrote:

<snipped for Thomas>
I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Hi Thomas,

I have been posting on usenet for ages. You are the first that complains
to me about my posting style. People complaint to me about other things
I wrote a lot, but lets leave that. ;-)
Yes, I know of the conventions you refer to, and I follow them when they
seem to make sense to me. A 2 line question is considered by me very
short and to the point, and I don't see how cutting would increase
readability for anyone with an IQ over 60.

And irritating people?
Me?
Check this very group and see which one of us gets/attracks the most
annoyed reactions...

>
I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
This is not the first time I hear you complain out in the open about
Randy being the FAQ maintainer.
Did you had an eye on that task and didn't get it maybe?
I don't know your history, but that returning comment surely makes me think.

Oh: Get happier man. It really helps.

Regards,
Erwin Moller
>

PointedEars
Nov 28 '07 #8
VK
On Nov 26, 2:17 pm, shapper <mdmo...@gmail.comwrote:
Hello,

How can I preload a few images of a page javascript?
Should I use CSS to do this? Is it even possible?
That is a question. Initially in Netscape 3.x they introduced
scriptable .src property for images so developers could achieve roll-
over effects for graphics menu elements. To avoid load delays for the
first mouseover they also introduced Image constructor. The purpose of
this constructor was that by making
var imgOver = new Image;
imgOver.src = 'some/url';
script issued load request for the new image so it would be pre-
cashed. As DOM 0 supported by all - even the most lousy - modern
browsers the answer would be "Yes, it is easy, use Image objects on
page load". But as much as I remember, this feature exposed browsers
to numerous cache misuse, like
var bogusImg = new Image;
bogusImg.src = 'some/10Mb-100Mb/image';
and as I remember some precaution limitation had been made up to stop
caching images completely on imgObject.src="url" assignments.
What browsers still do such caching and if any left at all is a good
question to check.

P.S. Maybe that would also explain the origin of FAQ 4.31
http://www.jibbering.com/faq/#FAQ4_31 that puzzled me all the time -
because no Web developers in any sanity would ever use server-side CGI
image generators for menu buttons nor would patch content header for
still images. I looked through the clj archives and the time this FAQ
was proposed overall matches to the period of "cache attacks" as my
weaked memory tells me :-) So possibly we have in this FAQ a dog
barking to an all wrong tree.
Nov 28 '07 #9
In comp.lang.javascript message <47**************@PointedEars.de>, Wed,
28 Nov 2007 00:40:52, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Established Usenet convention is to be reasonably tolerant, and not to
reply in a Gestapo-like fashion at any unimportant breach of one's
interpretation of the rules.

One notes that you are evidently found to be similarly arrogant and
obnoxious in de.c.l.j.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Nov 28 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by MALdito | last post: by
3 posts views Thread by Bob | last post: by
2 posts views Thread by Albert Spencil | last post: by
1 post views Thread by Stacey | last post: by
1 post views Thread by shapper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.