I wrote this answer in another question that was duplicated, and soon I want the answer to be close, so I will answer here. my two cents, and hope some other help anyway.
Since @Matt answered the reason [object object] , so you have three options for JSON.stringify(JSONobject) , console.log(JSONobject) or console.log(JSONobject) over the object, see the following basic example.
var jsonObj={ property1 : "one", property2 : "two", property3 : "three", property4 : "fourth", }; var strBuilder = []; for(key in jsonObj){ if (jsonObj.hasOwnProperty(key)) { strBuilder.push("Key is " + key + ", value is " + jsonObj[key] + "\n"); } } alert(strBuilder.join(""));
https://jsfiddle.net/b1u6hfns/
ncubica Jun 03 '15 at 23:14 2015-06-03 23:14
source share