[英]window.open opening new tab instead of new window in IE 11
I have an ASP.NET application which uses window.open.我有一个使用 window.open 的 ASP.NET 应用程序。 It opens a tab instead of a new window.
它打开一个选项卡而不是一个新窗口。 This happens in IE 11. In IE 8 it works fine.
这发生在 IE 11 中。在 IE 8 中它工作正常。
Since we are moving to IE 11 we want this to work on IE 11 too.由于我们正在转向 IE 11,我们希望它也适用于 IE 11。
var url = "reportViewer.aspx?reportname=" + $("#hfReportName").val() + "&schoolDistrict=" + district
window.open(url, "_blank");
I have done my research and here is what I found.我已经完成了我的研究, 这是我发现的。
I am not sure if that is the right way of doing this.我不确定这是否是正确的做法。 I want to do this through code.
我想通过代码来做到这一点。 Any idea how I can do this.
任何想法我怎么能做到这一点。 Let me know.
让我知道。 thanks in advance.
提前致谢。
The _blank
is for open in new tab. _blank
用于在新选项卡中打开。 Just remove the second parameter of window.open
, which is optional, it will work fine.只需删除
window.open
的第二个参数,这是可选的,它会正常工作。
Use it like this : window.open(url)
像这样使用它:
window.open(url)
"_blank" is the default for window.open. “_blank”是 window.open 的默认值。 You don't need it.
你不需要它。 Your link is opening in a new tab because of a browser setting, not code.
由于浏览器设置而不是代码,您的链接在新标签页中打开。 Go to Internet Options, General, Tabs.
转到 Internet 选项、常规、选项卡。 There is a section, "When a pop-up is encountered".
有一个部分,“遇到弹出窗口时”。 You would have to change this to "always open pop-ups in a new window".
您必须将其更改为“始终在新窗口中打开弹出窗口”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.