1> Conversion methods supported by the jQuery plugin :
$.parseJSON( jsonstr ); //jQuery.parseJSON(jsonstr), can convert json string into json object (javascript object)
2> Conversion methods supported by browsers (Firefox, chrome, opera, safari, ie9, ie8) and other browsers:
JSON.parse(jsonstr); //You can convert json strings into json objects
JSON.stringify(jsonobj); //You can convert json objects (javascript objects, or arrays) into json pairs
Note: ie8 (compatibility mode), ie7 and ie6 do not have JSON objects. It is recommended to use the official JSON method to introduce json.js.
3> Conversion methods supported by Javascript :
eval('(' + jsonstr + ')'); //You can convert a json string into a json object, note that you need to wrap a pair of parentheses around the json character
Note: ie8 (compatibility mode ), ie7 and ie6 can also use eval() to convert strings to JSON objects, but these methods are not recommended. This method is unsafe and eval will execute expressions in JSON strings.
4> The official JSON conversion method :
http://www.json.org/ provides a json.js, so that ie8 (compatibility mode), ie7 and ie6 can support JSON objects and their stringify() and parse() methods ;
You can get this js on https://github.com/douglascrockford/JSON-js, generally json2.js is used now.