View Full Version : document.onload

12-18-2003, 09:06 PM
I set up the following snippett:

function PageLoaded()
document.onload = PageLoaded;

Unfortunately, the alert is not being called. What am I doing wrong?

Additionally, if onload() is defined in the body tag, is there a way to add a call to what is already being called?

12-18-2003, 09:11 PM
I believe it's window.onload and not document.onload.

Hope that helps!

Happy coding! :)

12-19-2003, 09:28 AM
if onload() is defined in the body tag,

actualy in body you can call (fire, if you want...), a function, not to define. and onload is an event handler, not a function onload(), if you use it that way:

<body onload="aFunction()">

is similar with

function aFunction(){
window.onload = aFunction;