I am creating a script that parses the “rel” attribute of an anchor tag for a JSON String of settings. I am currently using something like this code to convert the string into a JavaScript Object:
var settings = new Function("return " + relAttribute);
Is this a good way to parse a JSON String?
I would recommend you json2.js and the
JSON.parsemethod. Example: