i have the same json string twice but the second time i get an error.
{"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
my code line devcontrol.js 8 and 9:
console.log(data);
data = $.parseJSON(data);
how can that be.
update i now made a console.log($) evry trime bevor he trys to convert the string into a json and got
undefined
it turnd out the secounde time it's undefined. i managed to found out it was because of zfdebug they used document ready and then asked about jquery noconfilect thats why $ was undifend the secound time
$
as a variable? What happens when you tryjQuery.parseJSON(data);
– Aesthete Nov 24 '12 at 2:04data
an object or a string? – charlietfl Nov 24 '12 at 2:06Description: Takes a well-formed JSON string and returns the resulting JavaScript object.
api.jquery.com/jQuery.parseJSON – charlietfl Nov 24 '12 at 2:09