js弹出窗口window.open(page.html)传参问题

js弹出窗口window.open(page.html)传参问题

js中function Openwin(aaa){
window.open("page.html?bbb=aaa");
}

获取

// 获取完整URL
var url=location.href;

// 获取对应参数
function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}
alert(GetQueryString("benid"));//
Last modification:December 14th, 2017 at 11:08 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment