javascript的eval方法来处理action层传回的json字符串成javascript对象
对于这么一个正常的字符串data:{"id":1111,"parentDetailId":null,"detailCode":"1111","detailName":"小樱","detailLevel":null,"detailCarrCode":null,"detailCarrName":null,"keepDateCode":null,
"keepDateName":null,"deliverDeptCode":null,"deliverDeptName":null,"saveSite":null,
"deliverRound":null,"verifyRound":null,"shelfRound":null,"shelfType":null,"batchFlag":null,
"detailTBNM":null,"createDTTM":null,"createId":null,"templateUrl":null,"fieldList":null}
转成javascript对象,
方法:
varaaa=null;
eval("aaa="+data+";");
或
方法:
varaaa=eval("("+data+")");
或者用jquery-json插件,官网:http://code.google.com/p/jquery-json/相关推荐
宿舍 2020-07-27
amazingbo 2020-07-21
wordmhg 2020-06-26
seanzed 2020-06-14
linxner 2020-05-18
ThinkingLink 2020-05-16
fansenjun 2020-03-01
赵家小少爷 2020-05-11
jessieHJ 2020-05-03
码农成长记 2020-04-19
Dreamhome 2020-04-16
巴壁虎 2020-03-03
amberom 2020-02-25
higheels 2020-02-18
JamesRayMurphy 2020-02-09
jyli 2020-01-21
容数据服务集结号 2020-01-17