我如何能够从我的 Web 服务获取此 json 中更新的值:
{"listener":{"id":"1","updated":"false"}}
这是我尝试过的:
$.ajax({
...
success : function(data) {
console.log("received listener: " + data);
var received = JSON.parse(JSON.stringify(data));
var listener = received.listener;
var length = listener.length;
//alert('returned json' + data + ' no. of products received: ' + length);
console.log('returned json' + listener + ' no. of listener received: ' + length); //it says undefined for the length
var updated = listener[0].updated;
}
});
谢谢。