jquery 怎么取出这个json的数据 比如 取出每个数组的id值?

2024-12-18 14:52:24
推荐回答(1个)
回答1:

jquery code如下:
$(function(){
var data=[
{"id":"3","topid":"1","sortrank":"1","typename":"\u516c\u53f8\u7b80\u4ecb","typedir":"cmspath}\/html\/about\/aboutus","tpeimg":"","description":"","keywords":"","content":""},
{"id":"4","topid":"1","sortrank":"1","typename":"\u4f01\u4e1a\u6587\u5316","typedir":"cmspath}\/html\/about\/wenhua","tpeimg":"","description":"","keywords":"","content":""}
]
$.each(data,function(index,domEle){
alert(domEle.id);
})
})