html - 如何在 IE8 的新选项卡中加载页面?

发布于 2024-08-25 18:07:50 字数 507 浏览 14 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

草莓酥 2024-09-01 18:07:51

在新选项卡中打开页面是 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.

请爱~陌生人 2024-09-01 18:07:51

我认为 W3.org 仍在解决此问题,但尚未在任何浏览器中实现。另请记住,Internet Explorer 将是最后一个实现它的浏览器;)

这是从 W3 工作草案复制的代码:

/* If a user wanted to have new windows open in new tabs instead, she could use the following user style sheet to do so: */

* { target-new: tab ! important }

当然,不可能在 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:

/* If a user wanted to have new windows open in new tabs instead, she could use the following user style sheet to do so: */

* { target-new: tab ! important }

Of course, it is impossible to set user preference in HTML or Javascript -- it would be unsafe.

℉絮湮 2024-09-01 18:07:50

这不是您可以通过 HTML 代码控制的事情,因为它应该由用户而不是文档作者决定如何打开链接。

要在新选项卡中打开弹出窗口,请按照 IE8 帮助中的说明进行操作:

更改弹出窗口的显示方式

在 Internet Explorer 中,单击“工具”
按钮,然后单击互联网
选项。单击常规选项卡,然后
然后,在选项卡部分中,单击
设置。在中进行选择
当遇到弹出部分时。
单击“确定”两次。

更新:
阅读 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:

To change how pop-ups are displayed

In Internet Explorer, click the Tools
button, and then click Internet
Options. Click the General tab, and
then, in the Tabs section, click
Settings. Make a selection in the
When a pop-up is encountered section.
Click OK twice.

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.

哆兒滾 2024-09-01 18:07:50

该问题的答案已发布在评论中(但现已删除)。现在您可以在 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.

慵挽 2024-09-01 18:07:50

浏览器如何解释目标取决于浏览器 - 每个供应商都会指定他们想要的内容。 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 user agent should load the designated document in a new, unnamed window.

The spec predates the wide usage tabbed browsing now has, so doesn't mention the concept anywhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文