$.parseJSON()报 对象不支持此属性或方法
[{"eqsn":"开卷线","Hour":"07:10:00","datetime":"2013-09-23","eqid":"2013092317151240038233190"},{"eqsn":"开卷线","Hour":"07:10:00","datetime":"2013-09-16","eqid":"2013092317200317045171826"},{"eqsn":"开卷线","Hour":"07:10:00","datetime":"2013-09-15","eqid":"2013092317203377322080592"},{"eqsn":"开卷线","Hour":"00:50:00","datetime":"2013-09-17","eqid":"2013092317332622322664873"},{"eqsn":"开卷线","Hour":"06:00:00","datetime":"2013-09-18","eqid":"2013092317351996072634767"}]
这个我循环拼出来的字符串,各位客官帮我看看哪里错了 ,为什么会报这种奇怪的错误!
[解决办法]
引用jquery
var strJson = '{"XXOOSS": [{"eqsn":"开卷线","Hour":"07:10:00","datetime":"2013-09-23","eqid":"2013092317151240038233190"},{"eqsn":"开卷线2","Hour":"07:10:00","datetime":"2013-09-16","eqid":"2013092317200317045171826"},{"eqsn":"开卷线","Hour":"07:10:00","datetime":"2013-09-15","eqid":"2013092317203377322080592"},{"eqsn":"开卷线","Hour":"00:50:00","datetime":"2013-09-17","eqid":"2013092317332622322664873"},{"eqsn":"开卷线","Hour":"06:00:00","datetime":"2013-09-18","eqid":"2013092317351996072634767"}]}';
var obj = jQuery.parseJSON(strJson);
//取值
alert(obj.XXOOSS[0].eqsn);
[解决办法]
首先确保引用了JQuery!
再测试取值: var obj = jQuery.parseJSON(strJson);
alert(obj.XXOOSS[0].eqsn); !