PDA

View Full Version : Need Help With "onLoad" Handler Please...


jimojeda
07-14-2002, 07:05 AM
Hello,

I've been working hard trying to figure out if it's possible to include two event handlers in the <Body> tag. Both need to be executed using the onLoad command. Currently, these are the two functions I want to load when the document loads...

doPopup()
arpInit();

My body tag looks like this: <BODY onLoad="doPopup()">

Since I need to include the second command into the tag, I modified it to look like this:

<BODY onLoad="doPopup()" onLoad="arpInit();">

But it seems that JavaScript cannot handle two "onLoad" commands in the same tag. Then I tried:

<BODY onLoad="doPopup()","arpInit();">

That didn't work either. You see, it works perfectly if I just do one or the other, but I would really like to find a way to have both load up. Is there any way?

Can you help me with this?

Sincerely,

Jaime Ojeda

Gordo
07-14-2002, 07:52 AM
How about the following...

<BODY onLoad="doPopup(); arpInit()">

Cloudski
07-14-2002, 10:51 AM
<BODY onLoad="doPopup(); arpInit()">

Darn... Gordo beat me to it:D

jimojeda
07-14-2002, 01:26 PM
Thank you guys!

I went ahead and tried it. I have it the other way around though. But when I tested it, I worked! I was jumping with joy! but then I tried it again, and nothing happened. I closed the browser, deleted internet files with cookies and all. I then went to my site again, and the Popup box with delay timer opens okay, but the alert box that should open immediatly as soon as the page loads still isn't working.

The funny thing is that it always worked perfectly before.

Please tell me if it works for you. Go to my site at http://www.instant-onlineempires.com/Welcome

As soon as it loads, there should be a box that should open that tells you to click OK twice to receive a free report. You can click "Cancel" if you want. Then just wait about 15 seconds, there should be a second window with a timer counting down from 10:00 minutes.

If both of these things happen for you, please let me know. If they don't, please let me know also so that I can keep modifying it to fix it.

Thank you for your kind assistance.

Sincerely,

Jaime Ojeda

joh6nn
07-14-2002, 03:21 PM
it all seems to be working for me. you just have to wait a decently long time for the window to popup. you might want to try shortening the delay.

jimojeda
07-14-2002, 07:45 PM
I appreciate you help, but did the alert box that asks you to subscriber to get a free report open? It's the type you can click on "OK" to subscriber or "Canel" if you don't want to.

Did it work okay for you?

I ask because as much as I try, I can't get it on my PC. So it makes me wonder if the JavaScript is corrupt or if it's just a problem with my own PC.

Thank you again for your help...

Sincerely,

Jaime Ojeda

Gordo
07-15-2002, 12:19 AM
On my 56K dial-up, your page took about 30 seconds to load...that's a long time. Once the page did load, the first "subscribe" (click ok) pop-up appeared. Several seconds later, the "you've been chosen" pop-up window appeared. So, those are working.

Something I'd probably remove are the extra lines at the very bottom of the page...
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>

If I had more time, I'd take a deeper look at your pages...but I don't at the moment.

P.S. The onUnload pop-up worked as well.

jimojeda
07-15-2002, 02:56 AM
Gordo,

Thank you for your advice and help with my site. You truly are a fine lad and a scholar! :thumbsup:

Really, that was very helpful information and I will definitely try to fine-tune my site.

Thanks again!

Sincerely,

Jaime Ojeda