我在执行代码时遇到错误。
的 ERRORL:
未捕获的TypeError:无法读取属性' name'未定义的
CODE:
$.ajax({
url: "/su/direct/dispatchorder",
type: 'POST',
data: {"shortFrom":shortFrom,"shortTo":shortTo},
success: function(content){
var obj = JSON.parse(content)
console.log(obj);
var objects = obj.length
var name = obj['name'];
var qty = obj['qty'];
for(i=0;i<=objects;i++)
{
document.getElementById('name').innerHTML=obj[i].name;
document.getElementById('qty').innerHTML=obj[i].qty;
console.log(obj[i]);
}
}
});
});