Mar 8, 2003 #1 JoJoH Programmer Joined Jan 29, 2003 Messages 356 Location US How do you combine 2 onload function in the body tag? Thanks in advance
Mar 8, 2003 #2 palbano Programmer Joined Oct 9, 1998 Messages 4,341 Location US Code: function doLoad(){ onload1(); onload2(); } </script> <body onload="doLoad()"> -pete Upvote 0 Downvote
Mar 8, 2003 Thread starter #3 JoJoH Programmer Joined Jan 29, 2003 Messages 356 Location US Hi Pete, Like this? <script language="JavaScript"> function doBoth() { runSlideShow(); writemenus(); } </script> <BODY onLoad="doboth()"> If yes, it is not working correctly, maybe I did something wrong? Please advice. Upvote 0 Downvote
Hi Pete, Like this? <script language="JavaScript"> function doBoth() { runSlideShow(); writemenus(); } </script> <BODY onLoad="doboth()"> If yes, it is not working correctly, maybe I did something wrong? Please advice.
Mar 8, 2003 #4 palbano Programmer Joined Oct 9, 1998 Messages 4,341 Location US <script language="JavaScript"> function doBoth() { alert("in doBoth" runSlideShow(); writemenus(); } add that. If the alert pops up then your problem is in one or both of the other functions yes? -pete Upvote 0 Downvote
<script language="JavaScript"> function doBoth() { alert("in doBoth" runSlideShow(); writemenus(); } add that. If the alert pops up then your problem is in one or both of the other functions yes? -pete
Mar 8, 2003 Thread starter #5 JoJoH Programmer Joined Jan 29, 2003 Messages 356 Location US I just did, and it is doing what it was doing before I added the alert function: It popped out a error dialog box saying: ine 371 Object expected I am not sure why but Line 371 is a bracket... <script language="JavaScript"> function doBoth() { <-----------------------------------------Line 371 runSlideShow(); writemenus(); } </script> Upvote 0 Downvote
I just did, and it is doing what it was doing before I added the alert function: It popped out a error dialog box saying: ine 371 Object expected I am not sure why but Line 371 is a bracket... <script language="JavaScript"> function doBoth() { <-----------------------------------------Line 371 runSlideShow(); writemenus(); } </script>
Mar 8, 2003 #6 xutopia Programmer Joined Apr 4, 2002 Messages 2,001 Location CA why bother with a function to call two other functions? <body onload="runSlideShow();writemenus()"> Why not that way? Gary http://www.xutopia.com Haran Upvote 0 Downvote
why bother with a function to call two other functions? <body onload="runSlideShow();writemenus()"> Why not that way? Gary http://www.xutopia.com Haran
Mar 8, 2003 #7 palbano Programmer Joined Oct 9, 1998 Messages 4,341 Location US you have tested each function separately yes? Code: <body onload="runSlideShow()"> and then Code: <body onload="writemenus()"> -pete Upvote 0 Downvote
you have tested each function separately yes? Code: <body onload="runSlideShow()"> and then Code: <body onload="writemenus()"> -pete
Mar 8, 2003 Thread starter #8 JoJoH Programmer Joined Jan 29, 2003 Messages 356 Location US Thanks guys for all your help, I have already got it figured out, thanks again! Upvote 0 Downvote