Posted By:
Stephen_McConnell
Posted On:
Tuesday, February 19, 2008 05:36 PM
Once in an chapter on Optimizing Web Applications, I read a suggestion that we put our Javascript at the bottom of the HTML, since if you are doing any DOM access, the Javascript can't access it until the HTML has loaded. And when loading the page, the some browsers will parse the Javascript before loading and rendering the HTML if it is at the top.
I tried it and it worked in Firefox, Opera and Safari, but didn't in IE... So much for consistency and optimizing page loading.
I found that unless I put the javascript at the top, sometimes my functions were not found. It has to do with how IE loads and recognizes the pages. Maybe that's what's happening when you place the Javascript in your "sub-page".
Sometimes, you just can't get there from here.
Stephen McConnell