...

View Full Version : multiple javascripts on one page, when I do at least one won't work



rscprod
08-13-2008, 03:55 PM
Hello all,
I'm trying to put multiple javascripts on one page, when I do at least one won't work.

The scripts I'm attempting to use are: HVmenu, Random Image Script, Advanced Gallery script, (these three were working fine together)
Testpage: http://wyandotte.net/home-test.htm

then when I added Scrollable content script II the HVmenu disappeared.
Testpage: http://wyandotte.net/home-test2.htm

So then someone suggested moving the onloads to the body tag which I did,
The HVmenu came back but the Scrollable content script II stopped working.
Testpage: http://wyandotte.net/home-test-onload.htm (http://wyandotte.net/home-test-onload.htm)

Any ideas out there, I'm kind of stumped?
I'm sure it's probably something really simple & I am just a big bonehead!

Thanks Rich :confused:

Philip M
08-13-2008, 04:12 PM
This topic has been covered a zillion times in this forum.

Have a look at:-

http://www.javascriptkit.com/javatutors/multiplejava.shtml

Another possiblity is duplication of variable/function names between the two scripts - the second will overwrite the first.


At least once per year, some group of scientists will become very excited and announce that whatever they announced last year about global warming is wrong.

rscprod
08-13-2008, 04:29 PM
thanks Philip M for the quick reply,

I have viewed http://www.javascriptkit.com/javatut...iplejava.shtml
and used similar advise for http://wyandotte.net/home-test-onload.htm
which helped but at the same time caused a diff script to fail.

I will go back and look over the code again to see if i missed something.

thanks Rich C

Philip M
08-13-2008, 04:50 PM
Make sure that all the scripts are loaded together in a <body onload = "..." statement

Another problem can be duplication of variable names, including counters

for (var i == 1; i <= 10; i++) {
if the variable i appears in another script it can cause problems.

This sounds to me the most probable cause if the three scripts worked before you added a fourth.

rscprod
08-14-2008, 03:21 AM
Thanks, issue resolved

prob was I was missing some parenthetical suffixes

- Rich

rscprod
08-14-2008, 03:22 AM
Thanks, issue resolved

prob was I was missing some parenthetical suffixes

- Rich



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum