Reputation:
I got a JSON converted from XML.
So, how can I get [email protected]
.
@
<-- this one will make javascript error
I use Javascript.
Upvotes: 0
Views: 2395
Reputation: 146510
Making a great exercise of imagination, I suppose you've used jQuery to download some JSON through AJAX and you have an object with a key called "@attribute", such as this:
var foo = {
"@attribute": 33
}
You just need to use square brackets:
console.log(foo["@attribute"])
Upvotes: 2