let paramsArray = window.location.search.substr(1).split(‘&‘), i, paramsObj = {}; paramsArray.forEach((item) => { i = item.indexOf(‘=‘); paramsObj[item.slice(0, i)] = item.slice(i+1); }) console.log(paramsObj)
原文地址:https://www.cnblogs.com/xjy20170907/p/11022544.html
时间: 2024-10-09 21:54:06