By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

Preloading Images and External JS File

P: n/a
Hi - I've inherited responsibility for our church's website. It has a
sizeable main menu, which uses mouseover image swaps. These images use a
pre-load script but the script is only included in the index.html page. My
javascript knowledge is weak, but it seems to me if a viewer arrives first
at page12.html, he gets no benefit of the preload script. My quandry -
Should I include the preload script on every page, or would this force each
of these images to download again everytime a viewer moves to a different
web page, thereby gumming up the whole works? If I don't add it to every
page, the viewer who enters thru a backdoor has a sluggish menu, right?

If the right approach is to include it on every page, can I do this with an
external js file? Will I need to call this file, or will it work just by
including the js statement in the <head> section:
<SCRIPT LANGUAGE="JavaScript" SRC="preloadscript.js"></SCRIPT>

Thanks very much for your help.
Oct 15 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
It shouldn't be any problem to include the file on every page. Yes, the
images will be placed into memory on every page, but they will not be
actually downloaded from the server every page -- they will be stored
in the user's cache. The same goes for the script file itself. Once the
information is on the computer, it will stay there until it is rotated
out of cache (which usually takes about four days for a heavy surfer
with a small cache.)

Oct 17 '05 #2

P: n/a
Joshie Surber said the following on 10/16/2005 10:59 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
It shouldn't be any problem to include the file on every page. Yes, the
images will be placed into memory on every page, but they will not be
actually downloaded from the server every page -- they will be stored
in the user's cache. The same goes for the script file itself. Once the
information is on the computer, it will stay there until it is rotated
out of cache (which usually takes about four days for a heavy surfer
with a small cache.)


No, the files will not always be kept in the cache. It depends on user
settings. I have mine set to "Empty Temporary Internet Files folder when
browser is closed".

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 17 '05 #3

P: n/a
> Please quote what you are replying to.

why? if there is only one question to reply to, there is no point
reminding everyone what it is... it just wastes bandwidth.
No, the files will not always be kept in the cache. It depends on user
settings. I have mine set to "Empty Temporary Internet Files folder when
browser is closed".


true, but anyone who is knowledgeable enough to do that will be aware
(or should be) aware of the extra page load time, and has decided to
accept it. besides, it is still cached across the browsing session you
are in now, when you go from one page of the site to another.

Oct 19 '05 #4

P: n/a
Joshie Surber said the following on 10/18/2005 9:37 PM:
Please quote what you are replying to.

why? if there is only one question to reply to, there is no point
reminding everyone what it is... it just wastes bandwidth.


Because most people in this group use a decent newsreader rather than
groups.google.com and in the process of doing that they do not keep a
perpetual archive of previous posts. So, quoting what you are replying
to - even if a single question - makes it a lot simpler to follow the
conversation.
No, the files will not always be kept in the cache. It depends on user
settings. I have mine set to "Empty Temporary Internet Files folder when
browser is closed".

true, but anyone who is knowledgeable enough to do that will be aware
(or should be) aware of the extra page load time, and has decided to
accept it.


That is not always true of the user though as the user is not always the
one who sets that preference. SysAdmins, Internet Cafe operators, etc...

besides, it is still cached across the browsing session you
are in now, when you go from one page of the site to another.


I never said it wasn't.

I said:
<quote>
No, the files will not always be kept in the cache. It depends on user
settings.
</quote>

I do not even agree with the statement that "it will stay there until it
is rotated out of cache" as IE is notorious for *not* doing that.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 19 '05 #5

P: n/a
> >>Please quote what you are replying to.


why? if there is only one question to reply to, there is no point
reminding everyone what it is... it just wastes bandwidth.


Because most people in this group use a decent newsreader rather than
groups.google.com and in the process of doing that they do not keep a
perpetual archive of previous posts. So, quoting what you are replying
to - even if a single question - makes it a lot simpler to follow the
conversation.


Well it seems to me that, given a protocol based upon conversation
threads, a "decent newsreader" would keep these threads together for
you, and given such, that excess quoted material just takes up too much
space.
<opinion type="personal" valid="true">
Part of why I have discarded the four or five newsreaders that I have
gone thru in favor of google groups is that google is the only one I
have found that is "decent" enough to group threads and hide all the
quoted cruft that litters usenet like empty beer bottles along a
highway.
</opinion>

Oct 22 '05 #6

P: n/a
Joshie Surber said the following on 10/22/2005 7:33 AM:
Please quote what you are replying to.
why? if there is only one question to reply to, there is no point
reminding everyone what it is... it just wastes bandwidth.
Because most people in this group use a decent newsreader rather than
groups.google.com and in the process of doing that they do not keep a
perpetual archive of previous posts. So, quoting what you are replying
to - even if a single question - makes it a lot simpler to follow the
conversation.

Well it seems to me that, given a protocol based upon conversation
threads, a "decent newsreader" would keep these threads together for
you, and given such, that excess quoted material just takes up too much
space.


And I don't want to keep an archive of every post that is posted here
just so I can keep up with a conversation.
<opinion type="personal" valid="true">
Part of why I have discarded the four or five newsreaders that I have
gone thru in favor of google groups is that google is the only one I
have found that is "decent" enough to group threads and hide all the
quoted cruft that litters usenet like empty beer bottles along a
highway.
</opinion>


Then you need a different medium than Usenet.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 23 '05 #7

P: n/a
Joshie Surber wrote:
Please quote what you are replying to.
It looks like a request to provide some sort of attribution for those
quotes is also warranted. So to mitigate:-
Randy Webb wrote: Joshie Surber wrote:

Randy Webb wrote:

Joshie Surber wrote:
why? if there is only one question to reply to, there is
no point reminding everyone what it is... it just wastes
bandwidth.

It doesn't waste bandwidth to provide a context for any reply made. It
is not often necessary (or desirable) to quote all of a post that is
being replied to. Indeed the 'correct' action is to trim quoted material
down to no more than is sufficient to provide a context for the response
given. This may, in many cases, be as little as a single sentence or
single line of code, depending on what it is that is being responded to.
Because most people in this group use a decent newsreader
rather than groups.google.com and in the process of doing
that they do not keep a perpetual archive of previous posts.
It is also the case that news servers only store posts for a limited
period, which older posts being dropped (either on a time-limited basis,
or when a total number of posts is exceeded, or when a total size limit
is exceeded). And as a question must precede its responses it is
entirely realistic (indeed inevitably common) that a question may have
been dropped form a news server while its responses are still available.
So, quoting what you are replying to - even if a single
question - makes it a lot simpler to follow the conversation.


Well it seems to me that, given a protocol based upon
conversation threads,


It would be more accurate to say "ephemeral conversation threads", as
long term storage and archiving were never part of the intention of
newsgroups (potentially useful as such may be in some contexts).
a "decent newsreader" would keep these threads together
for you, and given such, that excess quoted material just
takes up too much space.
Nobody is proposing "excess quoted material". The requirement is to
quote only what is sufficient to provide a context for the response
given. No more, but certainly no less. The benefits in not having to
look elsewhere, and reconstruct the context of a specific response from
the entire body of a post, far exceeds harm of the potential additional
bandwidth consumption.
<opinion type="personal" valid="true">
On the subject of communication that is one-to-many in nature the
opinion of an individual cannot outweigh the best interests of the many.
Part of why I have discarded the four or five newsreaders that
I have gone thru in favor of google groups is that google is
the only one I have found that is "decent" enough to group
threads and hide all the quoted cruft that litters usenet like
empty beer bottles along a highway.
</opinion>


Attempting to hide quoted material is one of the significant faults in
google's Usenet interface. It is inconvenient to continually be
expanding those quotes in order to see the context of a response, and
finding google treating closing braces in posted code as quoted material
is particularly disappointing.

But you may find it informative to consider this post. Remove all of the
quoted material and try reading my responses out of context. Does the
result make more or less sense than it would in context? Does the result
actually make any sense at all?

You should also consider the harm you do to others. Every time you post
an inappropriately formatted message you are encouraging some others to
do likewise. The simple truth is that individuals posting to this group
without regard for the conventions that apply to the formatting and
structuring of posts will find their questions being ignored by any of
the regular contributors who care. And you don't have to look very far
to observe that the majority of the potentially most useful regular
contributors to this group do care. You may not have a problem with
shooting yourself in the foot, but you should be circumspect about
encouraging others to do likewise.

Richard.

Oct 23 '05 #8

P: n/a
JRS: In article <11**********************@f14g2000cwb.googlegroups .com>
, dated Sat, 22 Oct 2005 04:33:40, seen in news:comp.lang.javascript,
Joshie Surber <jo**********@gmail.com> posted :
>>Please quote what you are replying to.
>
>
> why? if there is only one question to reply to, there is no point
> reminding everyone what it is... it just wastes bandwidth.


Because most people in this group use a decent newsreader rather than
groups.google.com and in the process of doing that they do not keep a
perpetual archive of previous posts. So, quoting what you are replying
to - even if a single question - makes it a lot simpler to follow the
conversation.


Well it seems to me that, given a protocol based upon conversation
threads, a "decent newsreader" would keep these threads together for
you, and given such, that excess quoted material just takes up too much
space.
<opinion type="personal" valid="true">
Part of why I have discarded the four or five newsreaders that I have
gone thru in favor of google groups is that google is the only one I
have found that is "decent" enough to group threads and hide all the
quoted cruft that litters usenet like empty beer bottles along a
highway.
</opinion>


News is not a conversational medium. Participants in a newsgroup have
other things to do, and so desire to be reminded of what has gone
before.

Accordingly, the agreed standards have always been to quote as much of
the previous material as will indicate the context of the reply.

Accordingly, well-designed news software - which does not mean Web-news
- is generally able to move from one new article directly to the next,
with a single key-stroke or click; and many use it in that manner.

Accordingly, proper quotation, with adequate attribution, in the right
order, is what the regulars want; it is necessary that you comply with
that if you wish to avoid being seen as perverse, idle, egocentric,
etc., and to be considered worth helping.
NOTE that the convention is to quote ONLY those parts of the previous
article that are needed to put the current one in context. Quoting all
is acceptable if the previous article was short; but if the previous
article was long, one should only quote as a reminder, given that the
previous article is accessible.
Is anyone here good at Latin?

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
The Big-8 newsgroup management is attempting to legitimise its questionable
practices while retaining its elitist hegemony. Read <URL:news:news.groups>.
Oct 23 '05 #9

P: n/a
JRS: In article <dj*******************@news.demon.co.uk>, dated Sun, 23
Oct 2005 16:03:55, seen in news:comp.lang.javascript, Richard Cornford
<Ri*****@litotes.demon.co.uk> posted :
Joshie Surber wrote:
>Please quote what you are replying to.


It looks like a request to provide some sort of attribution for those
quotes is also warranted.

FYI, your attribution does not meet the minimum considered adequate by
the USEFOR experts. As a minimum, the E-address should be included - we
have a plethora of Jims & Lees, and that would distinguish them.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Oct 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.