javascript says JSON object property is undefined although it's not
问题 I have a json-object, which I print to the screen (using alert()-function): alert(object); Here is the result: Then I want to print the value of the id to the screen: alert(object["id"]); The result is this: As you can see, the value of key "id" is not(!!!) undefined. What the hell is going on here?! 回答1: Looks like your json object is not really an object, it's a json string. in order to use it as an object you will need to use a deserialization function like JSON.parse(obj) . Many