Html target="_blank" 在 IE9 中打开一个新窗口,而不是一个新选项卡

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6661696/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 09:31:00  来源:igfitidea点击:

target="_blank" opens a new window in IE9, instead of a new tab

htmlinternet-explorer-8hyperlinkinternet-explorer-9anchor

提问by Saeed Neamati

In my link, I have target="_blank"attribute, and it works in Chrome, Firefox, Opera, and of course, Safari and opens the link a new TAB. But When I click on it, in IE9 (and IE8) it opens a new window instead of being opened in a new tab. What should I do?

在我的链接中,我有target="_blank"属性,它适用于 Chrome、Firefox、Opera,当然还有 Safari 并打开一个新的TAB链接。但是当我点击它时,在 IE9(和 IE8)中它会打开一个新窗口,而不是在新选项卡中打开。我该怎么办?

回答by Quentin

HTML and JavaScript provide no means to say if a new "window" should be a full window, or a tab, or whatever you want to call the Mobile Safari multiple views interface.

HTML 和 JavaScript 无法说明新“窗口”是否应该是完整窗口、选项卡或任何您想调用的 Mobile Safari 多视图界面。

So you live with it.

所以你忍受它。

回答by VAShhh

You can see in thisquestion that the target="_blank"is correct, but the way the browser handles this case is up to his settings.

您可以在这个问题中看到target="_blank"是正确的,但是浏览器处理这种情况的方式取决于他的设置。

You needto change IE8/9 settingsto open that kind of target in a new tab. There's nothing you can do :|

需要更改IE8/9 设置才能在新选项卡中打开此类目标。你无能为力:|

回答by noShowP

This is configured browser side and theres nothing you can do about it in your html I'm afraid. Its just an option that a user sets in their browsers preferences.

这是在浏览器端配置的,恐怕您在 html 中无能为力。它只是用户在浏览器首选项中设置的一个选项。

回答by crudedude

Unchecking Protected Mode in IE9 resolved my problem.

在 IE9 中取消选中保护模式解决了我的问题。

Windows Internet Explorer 8 and later. When Protected Mode is enabled and a webpage contains an anchor link with a named target, Windows Internet Explorer opens the target of the link in a new window when the target has a different integrity level than the webpage containing the link.

Windows Internet Explorer 8 及更高版本。当启用保护模式并且网页包含具有命名目标的锚链接时,当目标与包含链接的网页具有不同的完整性级别时,Windows Internet Explorer 会在新窗口中打开链接的目标。

Source: target attribute in IE

来源:IE 中的目标属性

回答by Markus Candido

You need to use the target="_blank"attribute to make links open in a new window or tab. Where the link actually opens is up to the browser settings. So if you have Tools > Internet Options > Tabbed Browsing Settings > "Always open pop-ups in new tabs"selected, a target="_blank"link will open in a new tab. Note that this type of link will open in a new window by default on most browsers.

您需要使用该target="_blank"属性在新窗口或选项卡中打开链接。链接实际打开的位置取决于浏览器设置。因此,如果您选择了“工具”>“Internet 选项”>“选项卡式浏览设置”>“始终在新选项卡中打开弹出窗口”target="_blank"则会在新选项卡中打开一个链接。请注意,默认情况下,此类链接将在大多数浏览器上在新窗口中打开。