HTML: how to force links to open in a new tab, not new window(HTML:如何强制链接在新选项卡而不是新窗口中打开)
问题描述
我使用 target="_blank" 在新标签页中打开链接.但在 IE 中,它会打开一个完全合乎逻辑的新窗口,因为这是 _blank 应该做的.
I use target="_blank" to open links in a new tab. But in IE it opens a new window which is completely logical because that is what _blank is supposed to do.
而且我不知道 target="_blank" 在其他浏览器中的行为.
And i don't know how target="_blank" behaves in other browsers.
有什么东西可以强制链接在新标签页中打开.如果浏览器支持标签... 否则创建一个新窗口
Is there something to force links to open in a new tab. If the browser supports tabs... else make a new window
推荐答案
作为浏览器呈现的 HTML 的作者,没有办法做到这一点.至少我所知道的还没有.它几乎取决于浏览器及其用户自己设置的设置/首选项.
There is no way to do that as the author of the HTML that a browser renders. At least not yet that I know of. Its pretty much up to the browser and its settings / preferences that are set by users themselves.
此外,您不应该将这一点强加给任何用户.浏览器是用户的财产.如果用户想要在选项卡或新窗口中打开所有链接,那么就让用户去做吧.
Also, you shouldn't impose this upon any user. A browser is the user's property. If a user wants to open all links in tabs or in new windows, then let the user do exactly that.
我们不能做某些事情很好.target=_blank 仍然被滥用并且弹出窗口已经被做死了.
It's good that we can't do certain things. target=_blank is still abused and popups have been done to death.
这篇关于HTML:如何强制链接在新选项卡而不是新窗口中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTML:如何强制链接在新选项卡而不是新窗口中打开
基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
