获取href 和src打开的jsp页面携带的参数
作者:互联网
function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
var ming;
function test1(){
alert(getQueryString("age"))
}
标签:function,src,return,getQueryString,href,jsp,var,null,reg 来源: https://www.cnblogs.com/san1/p/15700131.html