Possible Duplicate:
Accessing numerical property in a json object
Using the facebook graph api, i have returned the JSON:
“message”: “A3Media Uk Website is fully up and running! Tell your friends, We can’t make Beautiful Websites without clients!\n – Alex Morley-Finch”,
"message_tags": {
"116": [
{
"id": "514033508",
"name": "Alex Morley-Finch",
"offset": 116,
"length": 17
}
]
}
After parsing the JSON, I access the message via:
var json = JSON.parse(XmlHttpResponse.responseText);
json.data[index].message_tags.116[0].name;
this code should provide me with the name.
However because the 116 is an integer, the javascript wont allow it as an object name.
even thought that IS the object name!
So how do i access this variable?
You can use bracket notation: