Return to Snippet

Revision: 4871
at January 24, 2008 12:39 by ecavazos


Initial Code
function parseJSON(json){
    try{
        if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json)){
            var j = eval('(' + json + ')');
            return j;
		}
	}catch(e){
    }
    throw new SyntaxError("parseJSON");
}

Initial URL
http://www.json.org/js.html

Initial Description

                                

Initial Title
ParseJSON Simplified

Initial Tags
json

Initial Language
JavaScript