在jsp页面获取后台json数据
后台传过来的是一个JsonArray数组
var a = [{"crtTm":"2013-12-31 11:54:11.0","crtUser":5,"itemDate":"","itemId":2,"itemTm":"1","level":1,"pacId":1,"pacItemId":1,"updTm":"2013-12-31 11:54:11.0","updUser":5},{"crtTm":"2013-12-31 11:54:11.0","crtUser":5,"itemDate":"","itemId":13,"itemTm":"2","level":1,"pacId":1,"pacItemId":2,"updTm":"2013-12-31 11:54:11.0","updUser":5},{"crtTm":"2013-12-31 11:54:11.0","crtUser":5,"itemDate":"","itemId":4,"itemTm":"3","level":0,"pacId":1,"pacItemId":3,"updTm":"2013-12-31 11:54:11.0","updUser":5}] var b = eval(a); //转换为对象 alert(b[0].crtTm); //获取第一条数据的crtTm值 alert(b[1].crtTm); //获取第二条数据的crtTm值 alert(b[2].crtTm); //获取第三条数据的crtTm值
相关推荐
yangkang 2020-11-09
lbyd0 2020-11-17
sushuanglei 2020-11-12
85477104 2020-11-17
KANSYOUKYOU 2020-11-16
wushengyong 2020-10-28
lizhengjava 2020-11-13
星月情缘 2020-11-13
huangxiaoyun00 2020-11-13
luyong0 2020-11-08
腾讯soso团队 2020-11-06
Apsaravod 2020-11-05
PeterChangyb 2020-11-05
gaobudong 2020-11-04
wwwjun 2020-11-02
gyunwh 2020-11-02
EchoYY 2020-10-31
dingyahui 2020-10-30