jQuery中json对象与json字符串互换

jQuery中json对象与json字符串互换

(2014-03-03 13:35:37)
 
json字符串转json对象:jQuery.parseJSON(jsonStr);
json对象转json字符串:JSON.stringify(jsonObj);
 
IE中可能对unicode使用“\uXXXX”格式来编码,可以使用如下来解码:
function unicode2Char(str) {
return (str.replace(/\\/g, "%"));
}
posted @ 2015-10-28 11:00  JIN__JIN  阅读(349)  评论(0编辑  收藏  举报