EDIT: The problem was I wasn't specifying a base when I used parseInt. I want to understand exactly why this happened - I'll reward the answer to anyone who can tell me why this only created a problem for the values 08 and 09 in firefox!
I have a 2-dimensional array of integers stored as a JSON object in a MySQL database.
When I request this object via jquery's ajax, the JSON validates - it also passes through JSONLint without incident. I then translate it into a 2-dimensional javascript array, using parseInt to translate the string-only JSON keys into integer keys for the array.
This works just fine, on almost all browsers/platforms:
Original JSON:
....
"07": [0, 1...
"08": [0, 1...
"09": [1, 1...
"10": [1, 0...
....
For-loop output (Safari/Chrome, OSX):
JSON Key (parseInt value): [array]
....
07 (7): [0, 1...
08 (8): [0, 1...
09 (9): [1, 1...
10 (10): [1, 0...
....
For-loop output (Firefox OSX, iOS):
JSON Key (parseInt value): [array]
....
07 (7): [0, 1...
08 (0): [0, 1...
09 (0): [1, 1...
10 (10): [1, 0...
....
...what the heck? These keys (8 and 9) are the only ones that don't properly pass though parseInt, and it happens very consistently. I've verified that the JSON array comes into all browsers intact and unmodified - the fact that the keys remain 08 and 09 is evidence of that. However, as soon as 08 and 09 pass through parseint, they return 0. 18 and 19 pass properly, as do 28 and 29. There are no stray spaces, non-ascii characters, or anything else surrounding these two keys that could cause them to be read improperly. I'm completely stumped.
You can find my full JSON here. What am I missing?
Alternatively, if there's a way I can circulvent this completely, I'm willing to consider it. Thanks for the help, this is driving me nuts!