弹出拦截器问题 [英] Pop up blocker problem

查看:173
本文介绍了弹出拦截器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下html

 < form action =http://www.google.commethod = postname =firsttarget =_ blankid =first> 
< img src =loader.gifid =icon/>
< / form>
< / body>
< script type =text / javascript>点击(函数(){
document.first.submit();
})
// setTimeout(document.first.submit (),1 * 500);

在这里,点击图片时,它会提交表单,新标签会打开'http ://www.google.com'



当我在setTimeout或页面加载时执行相同的功能时,它会产生弹出式bloker,如何避免pop up blocker

解决方案

你不能。弹出窗口阻止程序通过阻止未被用户操作触发的弹出窗口来工作。这就是为什么它正在努力点击。

不幸的是,除非让用户明确允许来自您的网站的弹出窗口,否则我们无法在用户互动的情况下使用它。说服他们。


I have the following html

<form action="http://www.google.com" method="post" name="first" target="_blank" id="first">
    <img src="loader.gif"  id="icon"/>
</form>
</body>
<script type="text/javascript">
$("#icon").click(function(){
document.first.submit();
})
//setTimeout("document.first.submit()", 1 * 500);

In this, while clicking the image, it will submit the form and new tab will open with 'http://www.google.com'

When i do the same functionality, on setTimeout or in page load, it will produce popup bloker, how can we avoid the pop up blocker

解决方案

You can't. Popup blockers work by blocking popups that haven't been triggered by a users action. That is why it is working on click.

Unfortunately, you won't be able to get it to work without user interaction unless you get the users to explicitly allow popups from your site which I imagine would be quite difficult to convince them.

这篇关于弹出拦截器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆