/    Sign up×
Community /Pin to ProfileBookmark

One Script is Running another is not

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroAug 25.2003 — 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();
}
Copy linkTweet thisAlerts:
@sathysudhaauthorAug 26.2003 — 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
Copy linkTweet thisAlerts:
@pyroAug 26.2003 — You are welcome... ?
×

Success!

Help @sathysudha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...