我有两次相同的json字符串,但第二次出现错误。json使用jquery.parsejson解析相同json的错误
{"data":[{"ServerID":"1","UserID":"3","Name":"salzig","State_since":"2012-11-23T23:16:27.458000000","State":"saved","UUID":"Hardware 85f5d278-f6d6-49c2-87e7-c249d8002897"}],"error":[null,null,null]} devcontrol.js:8
{"data":[{"ServerID":"1","UserID":"3","Name":"salzig","State_since":"2012-11-23T23:16:27.458000000","State":"saved","UUID":"Hardware 85f5d278-f6d6-49c2-87e7-c249d8002897"}],"error":[null,null,null]} devcontrol.js:8
Uncaught TypeError: Object function (E,F)} has no method 'parseJSON' devcontrol.js:9
我的代码行devcontrol.js 8,9:
console.log(data);
data = $.parseJSON(data);
怎么可能。
更新 我现在做了的console.log($)埃夫里TRIME bevor他改掉的字符串转换成JSON并得到
undefined
它turnd出secounde时间是不确定的。 我设法找到了,这是因为他们使用的文件准备zfdebug,然后问jQuery的noconfilect这就是为什么$是undifend的谢胜利时间
您是否使用任何其他使用'$'作为变量的库?当你尝试'jQuery.parseJSON(data)时会发生什么;' – Aesthete
显示更多代码,json来自哪里。数据是一个对象还是一个字符串? – charlietfl
@charlietfl - 有什么区别? – Aesthete