I have the following json string:
{"nick":"person1", "text":"hello "}
I want to convert it into a object to access each variable.
I've tried the following:
var obj = $.parseJSON(text);
alert(obj.nick);
Where text is the json string.
This gives and error "Illegal character".
However, if i copy and paste the string itself and insert it into the parseJSON function it works..
Any ideas what could be wrong?