I have this little problem with json.
//real json
var json1 = {"test1":"TEST1","test2":"TEST2","test3":"TEST3","test4":"TEST4"};
alert(json.test1); // will echo TEST1
//string, so javascript treat it like a String not JSON
var json2 = "{"test1":"TEST1","test2":"TEST2","test3":"TEST3","test4":"TEST4"}";
alert(json2.test1); // wrong
Now I think you know what I mean, Is there any function or a way to convert that json-like string into a actual JSON?
Assuming your string is actually valid, eg (note the single quotes)
Use