This file creates a global JSON object containing two methods: stringify and parse. JSON.stringify(value, replacer, space) value any Javascr ipt value, usually an object or array. replacer an optional parameter that determines how object values are
在使用 JSON2.JS 文件的 JSON.parse(data) 方法时候,碰到了问题:
throw new SyntaxError(‘JSON.parse’);
查询资料,大概意思如下:
JSON.parse方法在遇到不可解析的字符串时,会抛出SyntaxError异常。
即:JSON.parse(text, reviver),This method parses a JSON text to produce an object or array. t can throw a SyntaxE