2013年9月24日
摘要: 这个问题出在php的json_encode环节,这个函数返回的json数据中会把空值写作null。想通过在js端这样把null转为空字符串是不可以的:JSON.parse(JSON.stringify(text));因为JSON的键值对必须双方都不为空。那么简单的办法就是在最终使用字符串的地方整个用str.replace(/null/g, '')替换一下。 阅读全文
posted @ 2013-09-24 17:36 any91 阅读(781) 评论(0) 推荐(0) 编辑