//weibo.com/props?age=12&salary=20000
function getQueryString(key){
var reg = new RegExp("(^|&)"+key+"=([^&]*)(&|$)");
var result = window.location.search.substr(1).match(reg);
return result?decodeURIComponent(result[2]):null;
}
//weibo.com/props?age=12&salary=20000
function getQueryString(key){
var reg = new RegExp("(^|&)"+key+"=([^&]*)(&|$)");
var result = window.location.search.substr(1).match(reg);
return result?decodeURIComponent(result[2]):null;
}
本文标题:浏览器地址url截取参数的完美工具方法(正则,好用)
本文链接:https://www.haomeiwen.com/subject/xjodwhtx.html
网友评论