#39;window.open#39; blocked by 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 阻止


基础教程推荐
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01