Click to See Complete Forum and Search --> : Multiple Scripts in on page


mattman
03-29-2004, 02:29 PM
Is there any reason that a second Java Script can not run on the same page.

On my Intranet site, I have a JavaScript Menu bar that runs. I am trying to add a second JavaSript, a simple scroller, but the scrolling action will not function.

What do I need to do to emlinate any conflicts between the two scripts?

I am using MS Front Page as my web page authoring program. The sizing and everything is viewable on the browser, yet none of the text is viewable.

:confused: HELP******

steelersfan88
03-29-2004, 03:09 PM
There are probably two lines such as:<body onload="someFunc()">
<body onload="someOtherFunc()">
<!-- and/or -->
window.onload=someFunc;
window.onload=someOtherFunc;Change this to:<body onload="someFunc();someOtherFunc()">Also, be sure that no global variable have the same name or that no function is named the same.

That should do it :)

EDIT: Back for more am I, I realized I also did not add the window.onload method above, as these lines could skip by, added in blue :)

rhsunderground
03-30-2004, 10:40 PM
another big thing to watch out for, especially when using premade scripts, is the variable 'i'.