'window.open' 被 Firefox 阻止

#39;window.open#39; blocked by Firefox(window.open 被 Firefox 阻止)

本文介绍了'window.open' 被 Firefox 阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 window.open 并在文档 ready 事件中调用它,但它被 Firefox 中的弹出窗口阻止程序阻止.然后我将它添加到函数中并从按钮调用此函数,然后触发按钮单击但没有成功:

I use window.open and call it at the document ready event, but it is blocked by a popup blocker in Firefox. Then I added this to the function and make a call of this function from a button and then trigger the button click without success:

$(function(){    
    abcd();    
});


function abcd(){
    var popup = window.open("http://localhost/johndyer-mediaelement-7ed6c51/demo/index.php","mypopup","width=500,height=300");       
 }

有没有办法在页面加载时在浏览器上打开外部弹出窗口或新标签页?

Is there some way to open an external popup window or new tab on browser when the page loaded?

推荐答案

不要打开弹窗广告.很烦人.

Don't open pop up advertising. It's annoying.

另一方面,如果它是用户想要看到的消息,那么您可以使用 jQuery 插件,如 Colorbox 以显示悬停模式窗口而不打开新的弹出窗口,用户可以轻松关闭.

On the other hand, if it's a message the user wants to see, then you can use a jQuery plugin like Colorbox to display a hovering modal window without opening a new popup, that the user can easily close.

这篇关于'window.open' 被 Firefox 阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:'window.open' 被 Firefox 阻止

基础教程推荐