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

    Var variable help

    I am having problems with an HTML document that I am working on with differen't java scripts in it. I have two java scripts with the var variable in it: 1: no right click, and 2: neon flashing lights .... this script will let you have a string that the letters will go from on color to the next.
    One script worked fine .. the no right click. When you right clicked the page, a message box appeared saying HEY BUD! DEWAYNE DOESN'T WANT YOU DOING THAT!!!. Now, since I put the neon flashing lights script ... the VAR tag in that one is showing up in the no right click box when you right click the page. The VAR string for the neon flashing is: TELL IT TO YOU STRAIGHT. And thats whats showing up in the no right click VAR string.
    Can anyone tell me how I can have both java scripts running on the page without the VAR string interfiering with each other?

    Thank you for your time.

    Jerry D. Moore
    jerry@jerrymoore.ws

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by yellowhawk View Post
    I am having problems with an HTML document that I am working on with differen't java scripts in it. I have two java scripts with the var variable in it: 1: no right click, and 2: neon flashing lights .... this script will let you have a string that the letters will go from on color to the next.
    One script worked fine .. the no right click. When you right clicked the page, a message box appeared saying HEY BUD! DEWAYNE DOESN'T WANT YOU DOING THAT!!!. Now, since I put the neon flashing lights script ... the VAR tag in that one is showing up in the no right click box when you right click the page. The VAR string for the neon flashing is: TELL IT TO YOU STRAIGHT. And thats whats showing up in the no right click VAR string.
    Can anyone tell me how I can have both java scripts running on the page without the VAR string interfiering with each other?

    Thank you for your time.

    Jerry D. Moore
    jerry@jerrymoore.ws
    in one of them you must change the variable name to be different in each place where apear. You can add a number for example, var msgstr become msgstr1.

    best regards

  • #3
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    ....and when you're stumped, get back together with the codes.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,922
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    We are not clairvoyant, so without seeing the scripts it is hard to help you.

    But my guess is that you have two variable and/or functions with the same name, and the second one overwrites the first,

    If as you seem to imply both scripts have a variable named variable then the remedy is obvious - rename one of them.

    No-right click scripts are a complete waste of time and are easily circumvented. See for example;:-
    http://websiteowner.info/articles/et...rightclick.asp
    And neon flashing lights are usually considered a no-no as well, guaranteed to irritate your visitors.


    Before a man speaks it is safe to assume that he is a fool. After he speaks it is seldom necessary to assume.
    H.L. Mencken 1880-1956, American Editor, Author, Critic, Humorist


  •  

    Posting Permissions

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