Ladies and Gentlemen,
Using javascript, how do I access ‘id’ in a JSON string that looks like this:
"graph": {
"edges": {
"edge": [
{
"@": {
"id": "3825279",
"label": "succeeds",
"source": "2746694",
"target": "2746515"
},
I am able to get edge, but I get stopped dead cold by the “@” sign:
alert(JSON.stringify(json.graph.edges.edge[0]));
which returns:
“@”: {
“id”: “3825279”,
“label”: “succeeds”,
“source”: “2746694”,
“target”: “2746515”
},
How do I access id in this object? I have tried:
json.graph.edges.edge[0].edge // undefined
The @ sign is an Object representing all attributes on the specified tag, but how do I use it?
Thank you in advance for your help!
Have you tried:
?