javascript的$.post中怎么处理回调函数json的数据啊?
Servlet中重数据库中查询出来的数据用newGson().toJson(list);封装好了[{"psId":1,"psTitle":"yilaio","psCont...
Servlet中重数据库中查询出来的数据用new Gson().toJson(list);封装好了
[{"psId":1,"psTitle":"yilaio","psContent":"asss","psDate":"2014-01-01","psType":1,"isDel":1},{"psId":2,"psTitle":"yyyyy","psContent":"afdsafsd","psDate":"2014-02-02","psType":1,"isDel":1}]
js页面:
$.post("pos", {
"option" : "all",
"typeId" : "-1"
}, function(date) {
//怎么处理?
}); 展开
[{"psId":1,"psTitle":"yilaio","psContent":"asss","psDate":"2014-01-01","psType":1,"isDel":1},{"psId":2,"psTitle":"yyyyy","psContent":"afdsafsd","psDate":"2014-02-02","psType":1,"isDel":1}]
js页面:
$.post("pos", {
"option" : "all",
"typeId" : "-1"
}, function(date) {
//怎么处理?
}); 展开
1个回答
展开全部
$.post("pos", {
"option" : "all",
"typeId" : "-1"
}, function(date) {
// 处理?
var o = JSON.parse(date);
// 然后开始 o.xxxx, o.xxxx 这样使用了
});
追问
追答
请求返回的原始数据贴上来看看。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询