Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.onload vs. <body onload =

Status
Not open for further replies.

jaschulz

Programmer
May 20, 2005
89
0
0
FR
What is the difference between window.onload and the onload event in the body tag? IE7 seems to treat them differently than FF2, Safari 3 and Opera 9 (Win XP PRO SP2). Is there a reason to prefer one over the other? Does it make a difference if window.onload appears in an imported script? Is there a document somewhere that explains this stuff?

Thanks,

JAS
 
>What is the difference between window.onload and the onload event in the body tag?
There isn't. The problem if any has to be viewed not from the difference but from the loading order point of view. The order usually is the document order. The last got loaded wins. What is the observation?
 
I am unable to reproduce what I was (or thought I was) seeing earlier. Sorry to have bothered you with this.

JAS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top