解决window.location.href切换页面造成的Request.UrlReferrer=null的问题

来源:互联网 发布:windows 显示隐藏文件 编辑:程序博客网 时间:2024/05/19 21:15

原文链接:点击打开链接

如果前一个页面使用了window.location方法导航到第二个页面,那么第二个页面的Request.UrlReferrer将为空。那么我们将换一种方法来实现页面导航,通过一个模拟点击一个链接实现页面导航。

var tempa = document.createElement("a");         tempa.href = url;         document.getElementsByTagName("body")[0].appendChild(tempa);         tempa.click()


0 0