如何解决无法看到IE版本11的引荐来源网址
我正在研究一个示例项目,并试图在IE中查看引荐来源网址。下面是我尝试的代码。有什么建议吗?
<html>
<head>
<title>First Web Application</title>
</head>
<body>
<span style="color: #ff0000; ">${errorMessage}</span>
<form method="post">
Name : <input type="text" name="name" />
Password : <input type="password" name="password" />
<input type="submit" />
</form>
<%--
<button title="Link that opens in a new window" onclick="window.location.href='https://localhost:8082/welcome-get?token=ghgshshdg'">Next</button>
--%>
<a title="Link that opens in a new window" onclick="window.open(this.href,'this.name');return false;" referrerpolicy="origin" href="https://localhost:8082/welcome-get?token=st566565">Next</a>
</body>
</html>
解决方法
有official document可以解决与引荐来源相关的问题,但此问题看起来有些不同。在将Referer从HTTPS传递到HTTPS时,我也可以看到该问题。在其他浏览器中,引荐来源可以正常运行。
我使用IE 11浏览器进行了一些测试,并试图缩小问题的范围。
我在您的代码中发现您正在尝试在新窗口中打开网页并获取空引用。我站在一边的结果也一样。
我建议您尽可能删除 OnClick 事件并尝试添加target="_blank"
,这将帮助您在新标签页/窗口中打开页面,并且还会传递引荐来源网址
示例代码:
<a title="Link" referrerpolicy="origin" href="https://Your_URL_here..." target="_blank">Next1</a>
在IE 11浏览器中的输出:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。