PDA

View Full Version : adding three scripts to a page with body unload


collie
10-26-2002, 02:15 PM
I added three scripts to a page where each script had its own event handler. Cannot get the scripts to work. If i use just two of the scripts it works. Here is the code i used.

<body onload="JSFX_StartEffects();window.onload=init();onload=strike()">

thanks
Ron

redhead
10-26-2002, 02:26 PM
try this:

<body onload="JSFX_StartEffects(); init(); strike();">

collie
10-26-2002, 04:13 PM
Sorry redhead that did not work. Have tried many combinations with no success.

pharma
10-26-2002, 06:51 PM
i encountered the same problem a few weeks ago. that syntax didn't worked for me as well. so what i did is, i combined all scripts that i need into one function. and it worked! hehehe..

Terry
10-26-2002, 07:38 PM
Works fine for me. You might want to even call the functions at the end of your script tag before the body even loads.


function JSFX_StartEffects()
{
alert(JSFX_StartEffects);
}

function init()
{
alert(init);
}

function strike()
{
alert(strike);
}
</SCRIPT>
</HEAD>

<body onload="JSFX_StartEffects(), init(), strike()">

Mr J
10-27-2002, 09:24 AM
The problem could be the scripts themselves.

If you can conflicting variables one might not run or affect the other.

In order to decide it might be best to see the scripts or give more details on any error messages.

collie
10-31-2002, 12:23 PM
Sorry IM just getting back to this. For now decided to use just two scripts. Will play around with your advices and post later.:)