标签:技术 sub data ext from substr url mic contex
let url = "https://mbd.baidu.com/newspage/data/landingsuper?context=哈哈&n_type=0&p_from=1";
let arr =url.substr(url.indexOf("?")+1).split("&");
console.log(arr)
let obj = {}
for (let i= 0;i<arr.length;i++) {
let arri = arr[i].split("=")
console.log(arr[i])
obj[arri[0]] = arri[1]
}
console.log(obj)
标签:技术 sub data ext from substr url mic contex
原文地址:https://blog.51cto.com/13550695/2462664