let url = window.location.href
let temp1 = url.split('?');
let pram = temp1[1];
let keyValue = pram.split('&');
let obj = {};
for (let i = 0; i<keyValue.length; i++){
let item = keyValue[i].split('=');
let key = item[0];
let value = item[1];
obj[key] = value;
}
console.log(obj)
console.log(obj.knowledgeMainId)
let id = obj.knowledgeMainId
console.log(id)
js从url上截取参数
最新推荐文章于 2024-06-21 10:19:20 发布