JS将对象转化为字符串

var student = new Object();
student.name = "张三";
student.age = "25";
student.location = "China";
var json = JSON.stringify(student);

document.location = "object:(" + json + ")";

猜你喜欢

转载自blog.csdn.net/github_33467146/article/details/81207638