html - 如何在 IE8 的新选项卡中加载页面?
html 和 IE8 设置的什么组合可以让 IE8 在新选项卡中打开链接。或者您可以在 IE8 中不执行此操作,而只能通过手动选择“文件”->“文件”来获取新选项卡。新/重复选项卡?
我的网站在 Firefox 中运行 - 网站上的页面在当前选项卡中加载,网站外的链接加载新选项卡。 IE8 不会表现:target="_blank" 打开一个全新的窗口;其他选项_self _top _parent,均在当前选项卡中打开页面。
我将 Firefox 设置为“在新选项卡中打开新窗口”。我网站上的页面链接都有 target="_self" ,并且 Firefox 将这些链接保留在当前选项卡中。在外部链接上,我没有设置目标(我添加了 _blank 以查看它是否修复了 IE8,并且这样做不会影响 Firefox)。
我在 IE8 中找不到等效的设置。工具-Internet选项-常规-选项卡/设置有一个启用选项卡框,以及一个自动切换到新打开的选项卡的子选项。有一些 html 可以工作吗?我缺少 IE8 设置吗?
任何帮助表示赞赏。
What combination of html and IE8 settings get IE8 to open links in a new tab. Or can you not do this with IE8, and you only get the new tabs by manually selecting File-> new/duplicate tab?
My website works in Firefox - pages on the site load in the current tab, and links off site load a new tab. IE8 won't behave: target="_blank" opens a whole new window; the other options, _self _top _parent, all open the page in the current tab.
I have Firefox set to "Open new windows in a new tab." The links to pages on my site all have target="_self" and Firefox keeps these in the current tab. On the external links I don't have a target set (I added _blank to see if it fixed IE8, and doing that didn't affect Firefox).
I can't find an equivalent setting in IE8. Tools-Internet Options-General-Tabs/Settings has an enable tabs box, and a sub-option to automatically switch to newly opened tabs. Is there some html that will work? An IE8 setting I'm missing?
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在新选项卡中打开页面是 html 标准未涵盖的概念。 Firefox 的行为只是浏览器中的一项设置,IE8 可能有也可能没有。
与此相关的是,我个人认为选择在新选项卡/窗口中打开页面是对网站的滥用。如果我希望它在当前选项卡/窗口中打开怎么办?
当然,在一个基本上完全是一个应用程序的丰富的类似应用程序的网站中,我发现在新选项卡/窗口中打开页面很方便。这使它们的工作方式更像桌面应用程序
对于普通页面,我建议根本不要设置目标并让用户决定。
Opening a page in a new tab is concept that believe is not covered by the html standard. The Firefox behavior is just a setting in the browser, which IE8 might or might not have.
On a related note, I personally find it abusive of websites to make the choice of opening a page in a new tab/window. What if I want it to open in the current tab/window?
Of course, in a rich application-like site that is basically entirely an application I find it convenient that pages open in a new tab/window. This makes them work more like desktop apps
For normal pages, I would suggest not setting the target at all and let the user decide.
我认为 W3.org 仍在解决此问题,但尚未在任何浏览器中实现。另请记住,Internet Explorer 将是最后一个实现它的浏览器;)
这是从 W3 工作草案复制的代码:
当然,不可能在 HTML 或 Javascript 中设置用户首选项 - 这是不安全的。
I think W3.org is still working on this issue, but it isn't implemented in any browser yet. Also remember that Internet Explorer will be the last browser to implement it ;)
This is code copied from a W3 Working Draft:
Of course, it is impossible to set user preference in HTML or Javascript -- it would be unsafe.
这不是您可以通过 HTML 代码控制的事情,因为它应该由用户而不是文档作者决定如何打开链接。
要在新选项卡中打开弹出窗口,请按照 IE8 帮助中的说明进行操作:
更新:
阅读 OP 对其他帖子的评论,似乎其目的是让所有外部链接在新选项卡中打开。然而,客户如何打开任何页面中的任何链接并不是文档作者的选择——它必须由客户决定。此外,即使您可以创建一个客户端脚本来设置“目标”属性来打开弹出窗口,但文档对象模型中没有“选项卡”的概念,因此即使在脚本中也无法执行此操作。
It is not a thing you can control from HTML code, as it should be user's, not document author's decision how to open a link.
To open pop-up windows in new tab, follow instructions from IE8 help:
Updated:
Reading OPs comments to other posts, it seems like the intent is to make all external links open in new tabs. However, it is not document author's choice how the client should open any link in any page - it has to be decided by the client. Moreover, even though you can create a client-side script which sets "target" property to open pop-up windows, there is no notion of "tab" in Document Object Model and hence you cannot do it even in a script.
该问题的答案已发布在评论中(但现已删除)。现在您可以在 IE8 中测试它 - 只需使用鼠标中键在新选项卡中打开链接。 Firefox 确实可以更好地使用选项卡。
The answer to the question was posted in the comments (but is now deleted). Now you can test it in IE8 - just use the middle mouse button to open the link in a new tab. Firefox does work better with tabs.
浏览器如何解释目标取决于浏览器 - 每个供应商都会指定他们想要的内容。 Firefox 决定使用新选项卡,IE 决定使用新窗口。
html 4.01 规范有这样的说法:“ _空白的”:
该规范早于现在广泛使用的选项卡式浏览,因此在任何地方都没有提到这个概念。
How the browser interprets the target is browser dependent - each vendor will specify what they want. Firefox decided to use a new tab, IE decided to use a new window.
The html 4.01 spec has this to say on "_blank":
The spec predates the wide usage tabbed browsing now has, so doesn't mention the concept anywhere.