Bootstrap

js实现将URL参数解析为一个对象

parseString(window.location.search)
    function parseString(url){
        var urlParams = new URLSearchParams(url)
        var paramsObj = {};
        for(var key of urlParams.keys()) {
            console.log(key)
            for(var val of urlParams.values()) {
                paramsObj[key] = val
            }
        }
        console.log(paramsObj)
}


;