从后台传到jsp页面的json对象怎么把数据都取出来呢
这是后台传到jsp的json对象怎么在jsp里面用jqery把它一条一条取出来呢在线等{"result":1,"data":{"id":"256","userid":"7...
这是后台传到jsp的json对象 怎么在jsp里面用jqery把它一条一条取出来呢 在线等
{"result":1,"data":{"id":"256","userid":"700","nickname":"test05","phone":"123","card":"0","age":"0","headpic":"0","level":"1","membertime":"0","gender":"0","address":"0","wx":"0","email":"0","source":"0","is_delete":"0","type":"1","product":[]}} 展开
{"result":1,"data":{"id":"256","userid":"700","nickname":"test05","phone":"123","card":"0","age":"0","headpic":"0","level":"1","membertime":"0","gender":"0","address":"0","wx":"0","email":"0","source":"0","is_delete":"0","type":"1","product":[]}} 展开
展开全部
$.ajax({
url: "test.html",
cache: false,
success: function(data){
console.log(data.data);
}
});
更多追问追答
追问
这样不行的最好是这样的
$(function (){
var object=${result};
for(var i = 0;iid:";
result+=""+object[i].data.id+"";
}
追答
$(function () {
$.ajax({
url: '你jsp地址',
cache: false,
success: function(data){
var data = data.data;
var id = data.id;
.... 取其他值都一样的
}
});
});
{
"result": 1,
"data": {
"id": "256",
"userid": "700",
"nickname": "test05",
"phone": "123",
"card": "0",
"age": "0",
"headpic": "0",
"level": "1",
"membertime": "0",
"gender": "0",
"address": "0",
"wx": "0",
"email": "0",
"source": "0",
"is_delete": "0",
"type": "1",
"product": []
}
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询