// 删除url中某个参数,并跳转
function funcUrlDel(name){
var loca = window.location;
var baseUrl = loca.origin + loca.pathname + "?";
var query = loca.search.substr(1);
if (query.indexOf(name)>-1) {
var obj = {}
var arr = query.split("&");
for (var i = 0; i < arr.length; i++) {
arr[i] = arr[i].split("=");
obj[arr[i][0]] = arr[i][1];
};
delete obj[name];
var url = baseUrl + JSON.stringify(obj).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&");
return url
};
}
---------------------
作者:FungLeo
来源:CSDN
原文:https://blog.csdn.net/fungleo/article/details/51742890
版权声明:本文为博主原创文章,转载请附上博文链接!
转载于:https://www.cnblogs.com/justsilky/p/10578144.html