RainingChain RainingChain - 4 months ago 6x
JSON Question

JSON Attribute Best Practice

Usually, what I see is


but writting this does exactly the same thing :

considered bad practice and should be avoided or not?


{attribute:241241} does not validate using JSONLint, so yes, it is bad practice and should be avoided.

Further, if you look at the JSON spec at json.org, you will find that for objects the first value is always a string (indicated by double quotes).