重定向窗口页面&选项卡到外部网站

Redirecting window page & tab to external website

本文关键字:选项 外部 网站 amp 窗口 重定向      更新时间:2023-09-26

我在打开外部网站的新窗口选项卡时遇到浏览器问题。

它应该做的是:当前窗口被重定向到一个页面,同时打开一个新的窗口选项卡并被重定向到外部页面。

它在Firefox上运行良好,但不支持IE或Chrome,因为它不打开新的窗口选项卡并重定向。然而,它确实将当前窗口上的fine重定向到我想要的页面。有人知道为什么吗?

<script type="text/javascript">window.open('Site A');</script> (This doesn't open in IE, and Chrome open in a new window instead of tab)
<script>top.location.href="Site B"</script> (This line works fine in FF, IE, and Chrome)
<script type="text/javascript">

尝试window.location而不是top.location.href.

您的代码看起来很好,理论上应该可以工作,请确保弹出窗口没有被浏览器阻止。