const urlLocation = {
search: "?ie=utf-8&f=8&rsv_bp=1&tn=15007414_dg&wd=%E6%95%B4%E7%90%86%E4%BB%A3%E7%A0%81%E6%88%90%E6%A0%91%E7%8A%B6&oq=%25E6%258E%2598%25E9%2587%2591&rsv_pq=dbb009cd0005f147&rsv_t=8988XeD5IPXRfhGBERKHKxh1B98CLiPxdb0z3SHeWxLbbi8Cjde%2Br7mMMzuVcamgwzk&rqlang=cn&rsv_enter=1&rsv_dl=tb&rsv_sug3=30&rsv_sug1=18&rsv_sug7=100&rsv_sug2=0&rsv_btype=t&inputT=9422&rsv_sug4=9422",
href: "https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=15007414_dg&wd=%E6%95%B4%E7%90%86%E4%BB%A3%E7%A0%81%E6%88%90%E6%A0%91%E7%8A%B6&oq=%25E6%258E%2598%25E9%2587%2591&rsv_pq=dbb009cd0005f147&rsv_t=8988XeD5IPXRfhGBERKHKxh1B98CLiPxdb0z3SHeWxLbbi8Cjde%2Br7mMMzuVcamgwzk&rqlang=cn&rsv_enter=1&rsv_dl=tb&rsv_sug3=30&rsv_sug1=18&rsv_sug7=100&rsv_sug2=0&rsv_btype=t&inputT=9422&rsv_sug4=9422"
}
const urlSP = new URLSearchParams(urlLocation.search);
function getQueryString(key) {
return urlSP.get(key)
}
const urlObj = new URL(urlLocation.href);
function getQueryString(key) {
return urlObj.searchParams.get(key)
}
const log = console.log;
log("ie", getQueryString("ie"));
log("wd", getQueryString("wd"));
console