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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.