[thelist] Preload images

.jeff jeff at members.evolt.org
Thu Feb 7 03:11:01 CST 2002


michael,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Michael Galvin
>
> It certainly looks a little more straight forward than
> Macromedia's code-f*ck.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

that was half the point of writing it.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> One question: what exactly is the difference between
> putting onLoad into the Body tag and using Window.onload
> in a JS script?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

putting it in the onload event handler of the <body> tag allows you to pass
arguments to the function you're call.  additionally, you can execute any
amount of javascript you want.  however, it also means you have to embed the
command in to the html of the page itself.

using window.onload, you can only call a single function and cannot pass
arguments to it.  however, you can place it in an external javascript file,
keeping the scripting separate from the html.  you can get around the
restriction of only being able to call a single function and not being able
to pass arguments by creating a wrapper function you call that does all your
work for ya.

it's really just personal preference.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/





More information about the thelist mailing list