本文介绍了在新窗口中打开链接(而不是选项卡)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我将目标属性用作target="_blank"
时,它将在新的tab
中而不是新的window
中打开.如何在Firefox 5中的新窗口中打开链接?
无效的新方法:
< a href =" faqs.html" href ="span> 目标 =" _ blank" 标题 =" 帮助和常见问题解答" önclick =" openWindow(this.href,500,600,'Yes'); return false" > 这是我的代码行< /a >
解决方案
这是用户可配置的,因此可以在计算机上的新选项卡中打开,但可以在其他用户的计算机上的新窗口中打开.您应该能够使用JavaScript来解决此问题.创建链接的点击处理程序,而不是导航到URL,而是使用 window.open
打开URL.请参见此处.
When I use the target attribute as target="_blank"
, it is opening in a new tab
instead of a new window
. How can I open a link in a new window in Firefox 5?
EDIT: New approach, which is not working:
<a href="faqs.html" target="_blank" title="Help & FAQs" önclick="openWindow(this.href,500,600,'Yes');return false">this is my line of code</a>
解决方案
That is user-configurable, so may open in a new tab on your computer but may open in a new window on another user''s computer. You should be able to get around this using JavaScript. Create a click handler for the link and, instead of navigating to the URL, use window.open
to open the URL. See here.这篇关于在新窗口中打开链接(而不是选项卡)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!