JS中怎么将json对象转化成字符串

如题所述

var data = {"aa":1}
//转换为String
var strData = JSON.stringify(data);
alert(strData);//输出,不再是[object object],而是{"aa":1}

具体讲解博客:http://www.sojson.com/blog/25.html
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜