第1个回答 2015-10-19
语法:
JSON.stringify(value [, replacer] [, space])
value:是必须要的字段。就是输入的对象,比如数组了、类了等等。
replacer:这个是可选的。它又分为2种方式,一种是方法,第二种是数组。
var student = new Object();
student.name = "Lanny";
student.age = "25";
student.location = "China";
var json = JSON.stringify(student);
alert(student);本回答被提问者和网友采纳