标签:获取 split 技术 script pre str function var href
function getQueryVariable() {
let query = window.location.search.substring(1);
let key_values = query.split("&");
let params = {};
key_values.map(key_val => {
let key_val_arr = key_val.split("=");
params[key_val_arr[0]] = key_val_arr[1];
});
return params;
}
链接: https://example.com?id=1&type=2
标签:获取 split 技术 script pre str function var href
原文地址:https://www.cnblogs.com/shih945/p/12682854.html