Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: Verifying that external js successfully downloaded


Message #1 by "Robert Nyman" <robert.nyman@c...> on Mon, 18 Nov 2002 12:30:25 +0100
The only way I know of is to, in your HTML file, check for a variable or
something
in the external JS file, and from that draw the conclusion if it has
been loaded or not.


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: HeadElf@E... [mailto:HeadElf@E...]
Skickat: den 17 november 2002 23:16
Till: javascript
=C4mne: [javascript] Verifying that external js successfully downloaded


In reviewing my log files I've noticed that a few times a day external
javascript files do not download onto the users' systems because the
server hiccups.

Is anyone aware of a script that would (a) verify that the js downloaded

and (b) force it to download if the first attempt failed?

I've run a search here and elsewhere (google groups etc.) to no avail
and
I'm afraid that this sinus medication has my head in a fog on how to do
this from scratch (I guess I need Rudolph the red-nose script writer ;).

BTW, I'm using the external js as a way to speed up d/load time,
decrease
bandwidth usage and improve search engine ranking.  Just put any non-
critical, repeating html (e.g. footers, feedback links and other site
marketing tools) into a js & then use good old "document.write" to read
the html back into all the pages.  While there are a number of reasons I

wouldn't do this for critical code, it can make a very noticeable
difference e.g. it dropped some file sizes by 20%.  (And who says Santa
doesn't give presents to 'older' kids ;)

Merry Christmas!


  Return to Index