Hi,
I'm using json2.js for this:
var str = '{"elements":[{"text": "", "colour": "#66AA50", "type": "line"}]}';
var obj = JSON.parse(str);
var str2 = JSON.stringify(obj);
var obj2 = JSON.parse(str2);
Weird thing is that obj2 is a broken version of obj, i.e it's not identical to it.
In my case obj2 has only one field, named elements which is set to string
"[{"text": "", "colour": "#66AA50", "type": "line"}]"
Tested in FF 3.0.14
The following scenario works fine if implemented via Prototype's .toJSON() / .evalJSON()
Is there something wrong with my code or JSON library?
Thanks!