上图为转换前后对比
平时页面链接传参为对象,我们需要转为字符串在传值,取值时又得转为对象,所以比较常用,就整理下吧!
JSON.stringify(obj)
JSON.parse(str)
原文地址 http://www.sharedblog.cn/post/228.html