Obviously you can do this unsafely with something like:
var jsonobj = eval("(" + jsonstr + ')');
but that leaves us vulnerable to the json string containing other code, which it seems very dangerous to simply eval.
If you're using jQuery just use:
jQuery.parseJSON( jsonString );
supported in all browsers。