I have a PHP page from which I get response in JSON:
[{'com':'something'},{'com':'some other thing'}]
I want to loop it and append each to a div.
This is what I tried:
var obj = jQuery.parseJSON(response);
$.each(obj.com, function(key,value) {
alert(key+':'+value);
}
This alerts as undefined
, and also response is the JSON array..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…