一个html页面传入参数到另一个html页面用js获取方法
时间:2017-04-08 12:53:39
收藏:0
阅读:311
没错使用以下函数就能够完整的获取到路径里的你想要的参数:
function getURLParameter(name) {
return decodeURIComponent((new RegExp(‘[?|&]‘ + name + ‘=‘ + ‘([^&;]+?)(&|#|;|$)‘).exec(location.search)||[,""])[1].replace(/\+/g, ‘%20‘))||null;
}
function getURLParameter(name) { return decodeURIComponent((new RegExp(‘[?|&]‘ + name + ‘=‘ + ‘([^&;]+?)(&|#|;|$)‘).exec(location.search)||[,""])[1].replace(/\+/g, ‘%20‘))||null; }
原文:http://www.cnblogs.com/zouchengli/p/6681179.html
评论(0)