uNConVeNtiOnAL said:
Hi -
I can't call my js until the page is loaded down to the </body> tag - is
there
something similar to body onload that I can use to automatically run the
script
just before the page is done loading ???
My observations as a somewhat newbie:
Inline code before <body> gets executed as it is read.
<body onload="..."> code gets executed allegedly after the page is
loaded, but it hasn't allowed me to refer to body elements further down in
body, like later div id's, widget object's onclick handler setup when the
widget is self-generated via doc.writes, etc. (IE and Mozilla?)
Code just before </body> wrapped in a <script></script> pair is the best
place I've found to have code that works on all types of objects since
everything has been defined before "here", it is here I often call an init()
routine (if it doesn't create any new html widgets w/ doc/write which should
be done exactly where they need to appear in body).
The main thing I learned is that the html & javascript is read and
processed once, from top down, so all online code can only refer to elements
it has read beforehand. Only functions that are called later (event
handlers) can be placed anywhere and refer to anything, with the hope that
they are not activated before a slow loading page finishes!
zin --
http://www.zintel.com