posts - 10, comments - 14, trackbacks - 0, articles - 0
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

公告

2011年4月20日

同时使用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 暴风雪 阅读(103) 评论(0) 编辑