RainingChain RainingChain - 1 year ago 132
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?

Answer Source

{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).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download