一个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; }

原文:http://www.cnblogs.com/zouchengli/p/6681179.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!