html页面跳转传递参数

https://www.jianshu.com/p/aa618ddfdb42

 

function getParams(key) {
var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
};

 

 

 

 

 

posted on 2019-11-29 13:54  大孟子  阅读(177)  评论(0编辑  收藏  举报

导航