版权声明:拒绝盗版 https://blog.csdn.net/weixin_42981560/article/details/85268433
<script type="text/javascript">
//获取网址
window.onload = function() {
//?id=001&name=iphone7%20plugs&imgurl=img/ip7.jpg&price=5899&sale=5888&color=%E5%9C%9F%E8%B1%AA%E9%87%91
//?id=001&name=iphone7 plugs&imgurl=img/ip7.jpg&price=5899&sale=5888&color=土豪金
var data = decodeURI(location.search);//解码的方法
var str = data.slice(1);
var good = strToObj(str);
console.log(good);
}
</script>