#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 阻止


- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Fetch API 如何获取响应体? 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01