This is sample JSON code received from Wikipedia:
{"pages":{"7955":{"pageid":7955,"ns":0,"title":"DNA","links":[{"ns":0,"title":"5' cap"}]}}}
Now doing
alert(JSON.stringify(data.pages));
works fine. However, but
alert(JSON.stringify(data.pages.7955));
doesn’t work. I’m thinking that maybe it’s because 7955 starts with a digit, which might be illegal.
Any thoughts?
or