简体   繁体   English

window.open 在 IE 11 中打开新标签而不是新窗口

[英]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.

相关问题 为什么window.open(url)打开新窗口而不是tab - why is window.open(url) opening new window instead of tab Window.open打开空白的新标签? - Window.open opening blank new tab? Javascript - window.open() 未在新选项卡中打开 - Javascript - window.open() not opening in new tab 我的window.open打开一个新窗口,而不是一个新选项卡 - My window.open open a new window instead of a new tab JavaScript:window.open() 函数在新窗口中打开链接,而不是在 IE7 中证明相同的窗口名称 - JavaScript : window.open() function opening link in new window instead of proving same window name in IE7 带有'noopener'的Window.open打开一个新窗口而不是一个新选项卡 - Window.open with 'noopener' opens a new window instead of a new tab window.open打开一个新选项卡而不是一个新窗口(在chrome中) - window.open opens a new tab instead of a new window (in chrome) Selenium IE驱动程序将打开新窗口,而不是window.open()上的新选项卡 - Selenium IE Driver opens new window instead of a new tab on window.open() window.open在新标签页而不是弹出窗口中打开页面 - window.open open the page in a new tab instead of in popup window window.open在新选项卡中打开外部链接 - window.open external link opening in new tab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM