PDA

View Full Version : Using reserved keywords


noctourne
05-19-2009, 05:31 PM
Hi I'm having a little trouble getting my javascript to work

I've pinpointed it down to this line of code

locations.styleMap.styles.default.defaultStyle.fillColor = '#' + color;

I put the entire thing through JSLint, and this error regarding using reserved words came up, specifically about the 'default'.

From what I understand is, the word is a reserved word so I cannot use it in any form I please, but as you can see, I need to use it in that fashion to get to the child variables.

Also, the locations object is from another library, so it would be best if I didn't go about changing the library variable name.

Also, unfortunately there is no getter method for the default variable either.

What's interesting is that this code runs fine in Firefox, but not Google Chrome or IE.

Any help is appreciated, thanks!