View Full Version : Onload script

12-25-2006, 04:05 PM
1) Script Title: Multiple onload scripts??

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/clock2.htm

3) Describe problem: <body onLoad="show_clock()">

how many times can i load the onload in the body tag?? whats the syntax and can i use it anywhere else?

12-26-2006, 08:15 PM
There can be only one onload. However, one can enter multiple statements separated by semicolons:
<body onload="a(); b(c); d(e, f, g);">

12-26-2006, 08:39 PM
Note that each statement must be unique. If you want multiple clocks on your page, that's a more complex question, in which you would need to change all the variable and function names to make them unique.

12-26-2006, 08:58 PM
Note that each statement must be unique.Why so?

12-26-2006, 09:32 PM
Well, sure, go ahead and call the same function twice. But it won't do anything except in really rare circumstances.

12-27-2006, 12:52 PM
thanks all :P