View Full Version : Variable names with _ character

Philip M
01-11-2003, 09:53 PM
I have a script which has worked fine until recently, but as far as I can make out is not working properly in Netscape 6 or possibly Netscape 7. The only thing I can see which MIGHT cause this is that some variable names include an underscore character, e.g. first_name. There is no CSS involved.

Any comments, please? Has Netscape 6 any glitches of this kind?
Is Netscpe 6 or 7 supplied to aol users instead of MSIE?

01-11-2003, 10:12 PM
For the first part, I'd ask that you either post the script, or post a URL to the script (personally, I'd prefer the latter).

For the second part, IE is the rendering engine for all Windows versions of AOL, as well as earlier versions for Mac OS 9 and earlier. However, AOL 7.0 for Mac OS X has the Gecko rendering engine -- the same version as Netscape 7.0.

Philip M
01-11-2003, 11:07 PM
Thanks, Skyzyx. Obliged for the information.

Another possible source of the problem -

I know that Javascipt is case sensitive, yet onFocus works as does onfocus, and I have often seen onblur & OnBlur, onload & onLoad etc. apparantly used interchangeably. Is this in fact correct?

Is there in fact any reason why onFocus might not work in certain browsers where onfocus does work?

01-12-2003, 06:45 AM
Hi Philip,

onFocus or onfocus, etc. shouldn't matter, as that's HTML, not JavaScript. HTML is NOT case-sensitive (unless you're talking about XHTML, which as far as I know still isn't case-sensitive unless you want to validate it, or you're concerned about coding to standards, which IMHO everyone should be).

The problem must lie elsewhere.

JavaScript is indeed case-sensitive, though... so any references to functions, variables, etc. must be in the same case, and this also applies to any references to form variables, since they become part of the Document Object Model (DOM).

FYI, variable names with underscores (i.e. my_form) in them shouldn't matter at all, as long as they are referenced correctly.

Obviously the problem lies elsewhere, as I stated above - do you have a URL or code as an example, and perhaps a copy of the error message? :)

Philip M
01-12-2003, 10:21 AM
Thanks a million, Whammy!

You are right - I have discovered that the problem lies elsewhere, with a particularly subtle coding imperfection which enabled some oh-so-clever users to circumvent the form validation.

Problem solved! Long live Whammy and CodingForums!