同时使用JSON2.js和prototype,会导致json方法对于数组对象处理出现错误。
解决方案是:使用json2的json方法,但要增加附加函数来修正。
json_data = JSON.stringify(outAcctList_groupInfo, function(key, value) {
if (typeof this[key] == 'object' && Object.prototype.toString.apply(this[key]) === '[object Array]') {
return this[key];
} else {
return value;
}
});
posted @ 2011-04-20 18:32 暴风雪 阅读(272) 评论(0) 推荐(0) 编辑