JS将对象转化为字符串

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

© 2017. All rights reserved.

Powered by Hydejack v7.5.0