Possible Duplicate:
JSON Spec – does the key have to be surrounded with quotes?
Which is the correct syntax?
{ key: "value" } or { "key": "value" }?
I’ve seen it both ways and in my tests both work, but I’m just curious which one is syntactically correct?
JSON requires keys to be quoted. JavaScript does not. So for JSON, your second example is correct.