Hi Is there any other way I can eval json string.
My example:
var json='[{ data: {id:"oxid"},group:"nodes"},{ data: {id:"e40", source:"HK1",target:"oxid"},group:"edges"},{ data: {id:"skeletal muscles"},group:"nodes"},{ data: {id:"e41", source:"HK1",target:"skeletal muscles"},group:"edges"},{ data: {id:"atp"},group:"nodes"},{ data: {id:"e42", source:"HK1",target:"atp"},group:"edges"},{ data: {id:"mitochondria"},group:"nodes"},{ data: {id:"e43", source:"HK1",target:"mitochondria"},group:"edges"},{ data: {id:"mitochondrial"},group:"nodes"},{ data: {id:"e44", source:"HK1",target:"mitochondrial"},group:"edges"},{ data: {id:"metabolism"},group:"nodes"},{ data: {id:"e45", source:"HK1",target:"metabolism"},group:"edges"},{ data: {id:"rat"},group:"nodes"},{ data: {id:"e46", source:"HK1",target:"rat"},group:"edges"},{ data: {id:"binding"},group:"nodes"},{ data: {id:"e47", source:"HK1",target:"binding"},group:"edges"},{ data: {id:"HK1"},group:"nodes"},]';
It seems I can not use JSON.parse() or jQery.parseJSON() to evaluate it, there is error there. Thanks.
update: the string is created by my program automatically, I use javascript to concatenate several string variable to get variable json. The json string is not hard coding one. Actually, I can use eval(json), it's working, but I heard it's dangerous to use eval() in my javascript.