...

View Full Version : Var variable help



yellowhawk
09-05-2008, 04:03 AM
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

oesxyl
09-05-2008, 04:15 AM
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

rangana
09-05-2008, 05:45 AM
....and when you're stumped, get back together with the codes.

Philip M
09-05-2008, 07:32 AM
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/ethics/norightclick.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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum