Can you put spaces in a JSON key? My JSON object comes from a database so I can't change it.
For example, "first Name" below has a space in it.
var JSON_text =
{
"first Name": "John",
"lastName": "Smith
}
Using eval("JSON_text." + "first Name") or
eval("JSON_text[" + "first Name" + "]")
do not work. JSON is very limited if it can't use keys with spaces in them.
Thanks
For example, "first Name" below has a space in it.
var JSON_text =
{
"first Name": "John",
"lastName": "Smith
}
Using eval("JSON_text." + "first Name") or
eval("JSON_text[" + "first Name" + "]")
do not work. JSON is very limited if it can't use keys with spaces in them.
Thanks