views:

19

answers:

1

For Example:

myJSON = {
  param1:val1,
  param2:val2
}

vs.

myJSON = {
  "param1":val1,
  "param2":val2
}

Also are there any browser compatibility issues or possible exceptions that may arise out of using one or the other?

+3  A: 

In JavaScript, names in object literals do not need to be surrounded in quotes, unless they are illegal JavaScript names (e.g. they contain a special character like a dash, they are a reserved word, etc).

In the JSON data exchange format, all names must be surrounded by double quotes.

bdukes
well this is in a script file no data exchanges =]
codeninja