Click to See Complete Forum and Search --> : One Script is Running another is not


sathysudha
08-25-2003, 07:47 AM
Hi Friends

I have two javascripts one is for "running pictures" from left to right.
another in is for "newsScroller" from top to bottom.
if i use both the script , then the "running pictures" script is not working.
if i stop the newsscroller script then only the "running pictures" is working.
so what might be the reason.
how can i solve this?
waiting for the help

thanks
sudhakar

pyro
08-25-2003, 07:57 AM
Seeing code is always a good thing. With what you've told us, all we can do is guess, so my guess is that they both use the onload event handler. You can only use the onload event handler in javascript once, so if both scripts call it, it won't work. You can, however, run more functions onload by using something like this:

<body onload="functionOne(); functionTwo();">or in the actual script:

onload = new Function() {
functionOne();
functionTwo();
}

sathysudha
08-26-2003, 05:20 AM
Hi Pyro

Thanks for your help.
Its working.
what i did is?
one script i put it in the body onload.
another script i put it in the window onload.
thats why there is some messup.
now i put both in the body onload.
now everything is fine.

once again thanks


sudhakar

pyro
08-26-2003, 06:59 AM
You are welcome... :)