xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
console.log(xmlHttp.responseText);
var list =JSON.parse(xmlHttp.responseText);
console.log(list);
for ( var i = 0; i < list.length; i++) {
}
}
};
你这个JSON就是有问题的 至少key是需要引号引起来的
应该是这样的
{"total":2,"rows":[{"URL":"1.png"},{"URL":"2.png"}]}