[thelist] NN4.7 not showing my Home page/images

sfmalo sfmalo at msn.com
Mon May 28 02:41:27 CDT 2001


It turned out to be a closing brace that I had not placed in the correct
position. The nav menu is working fine now. But, thank you for the advice.
Will keep it for future reference. And, thanks for the compliment.

Two questions:
1) You suggested placing the external js script tag in the body section. Is
that in addition to or instead of placing the same script file tag in the
head section?

2) Also, re the decision to split the script file into two (placing one new
file tag in the head and the other in the body): I am going to be using this
same script for a site that will be loading far more images (42 nav images
vs the 24 on my site) for the navigation. Then, would it be wise to split
the file into two?

 I'm not exactly clear what instructions should go in which file. I now have
1) an opening "if(document.images)" statement followed by the variables, 2)
a second "if(document.images" statement followed by "for" and three "new
Image" references, and 3) three "function" statements. Am pretty new to
javascript so please forgive me if I have not used the correct terminology
here.

You are due at least three dodos and a crate of apples for free for this
one.
Sharon

Keith wrote:

> Solution. Place the external js tag in the body section, the first thing
> in the body section. If you load a really immense js file from a tag in
> the body you will notice that the page pauses its display at that point
> until the js file has fully arrived in the browser. That's by design
> since an external js could contain document.writes that affect the page
> layout. It also guarentees that your js file has arrived and been
> examined by the HTML engine for document.writes before the onload event
> triggers.
>
> It still takes time to compile and register the script in the script
> engine. So on small pages with large js files it's sometimes necessary
> to insert a half second setTimeout. But on your page that will not be
> necessary. Also, since an external js tag in the page causes a pause in
> page display it slows down reduring the page, not a good deal. So, one
> should split up a large js file, if possible, placing only the onload
> functions and any associated variables and/or any doc.writes in the
> body, and all other functions and variables in the head.

---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com





More information about the thelist mailing list