(1)JSON.parse 函数 var json = '{"name":"GDT","age":23,"University":"GDUT"}'; var info = JSON.parse(json); //解析为JSON对象 document.write(info.name + ' is a student of ' + info.University + ' and he is ' + info.a…
在Firefox,chrome,opera,safari,ie9,ie8等高级浏览器直接可以用JSON对象的stringify()和parse()方法. JSON.stringify(obj)将JSON转为字符串.JSON.parse(string)将字符串转为JSON格式: var a={"name":"tom","sex":"男","age":"24"}; var aToStr =…