Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    multiple javascripts on one page, when I do at least one won't work

    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

    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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    This topic has been covered a zillion times in this forum.

    Have a look at:-

    http://www.javascriptkit.com/javatut...iplejava.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.

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    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.

  • Users who have thanked Philip M for this post:

    rscprod (08-14-2008)

  • #5
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks, issue resolved

    prob was I was missing some parenthetical suffixes

    - Rich

  • #6
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Issue resolved, Thank you

    Thanks, issue resolved

    prob was I was missing some parenthetical suffixes

    - Rich


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •