如何在页面加载时始终允许弹出窗口阻止程序 [英] how to always allow the pop-up blocker in page load

查看:89
本文介绍了如何在页面加载时始终允许弹出窗口阻止程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何在页面加载时总是允许弹出窗口阻止程序,



当我在页面中调用该函数时加载它是由浏览器阻止,如何允许直接编码,窗口应该只在页面加载时触发..



没有阻塞,如何在页面加载中打开新窗口请帮我看看怎么做



hi guys ,
how to always allow the pop-up blocker in page load ,

When i call the function in page load it is blocking by the browser, How to allow directly from coding , the window should fire on page load only ..

with out blocking, how to open new window in page load please help me frnds how to do

<script type="text/javascript">
        function OpenPopup() {

            window.open("ProductClass.aspx", "List", "toolbar=no, location=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width=900,height=500,left=430,top=100");
            return false;
        }
</script>
when i call this in code behind browser is blocking please tell me how to do ..



谢谢和问候

mani。


thanks and regards
mani.

推荐答案

这听起来很荒谬,对不起。如果可以通过编写不同的JavaScript代码来规避某些浏览器的阻止程序,谁会费心去安装这样的浏览器呢?如果它阻塞,它会阻塞。浏览器始终扮演主动角色并完全控制其行为,服务器仅提供一些内容以响应HTTP请求,并且无法控制客户端的行为。如果有可能,谁会信任互联网安全?



所以,真正的解决方案是:不要使用弹出窗口。它们不方便,干扰并经常被阻挡。还有更好的选择:模拟单个网页内的模态行为。



首先,这是jQuery对话框:https://jqueryui.com/dialog [ ^ ]。



有许多第三方jQuery插件统称为模态弹出窗口。它们具有不同的令人印象深刻的视觉效果,例如过渡,尤其是窗口调光。请参阅: http://bfy.tw/AJH [ ^ ]。



祝你好运。

-SA
It sounds absurd, sorry. If some browser's blocker could be circumvented by writing different JavaScript code, who would ever bothered to install such browser? If it blocks, it blocks. The browser always plays the active role and has full control over its behavior, and the server only provides some content in response to HTTP request and cannot control the behavior of the client. If it was possible, who would trust Internet safety?

So, the real solution is: don't use popup windows. They are inconvenient, intrusive and are often blocked. There are much better alternatives: simulation of modal behavior inside a single Web page.

First of all, this is jQuery Dialog: https://jqueryui.com/dialog[^].

There are many 3rd-party jQuery plug-ins collectively known as "modal pop-ups". They feature different impressive visual effects, such as transitions and, notably, the window dimming. Please see: http://bfy.tw/AJH[^].

Good luck.
—SA


你不能。这是一个浏览器功能,如果您可以通过JavaScript禁用它,每个站点都会这样做。



充其量你可以测试它是启用还是禁用某些东西如您的应用程序代码中的以下内容:



You cannot. This is a browser feature, which if you could disable it via JavaScript, every site would be doing it.

At best you can test if it’s enabled or disabled with something like the following in your applications code:

winpop = window.open("asdf.html");
if(!winpop || winpop.closed)alert("Popups are required");





您还可以查看更改浏览器设置/可信站点允许来自这个单一域/站点的弹出窗口。



我还没有探索的其他选项是将站点添加到可信站点区域/允许来自站点的弹出窗口组策略(如果在域/公司环境中)与上述大致相同,只需通过组策略进行控制。





是其他方式,但不能使用代码解决方案AFAIK。



-DB



You could also look at changing the browser settings / trusted sites to allow the popups from this single domain/site.

Other options which I have not explored, is adding the site to trusted sites zone / allowing popups from the site via Group Policy (if in a domain / corporate environment), much the same as above, just controlled via group policy.


There may be other ways but an on-code solution is not possible AFAIK.

-DB


这篇关于如何在页面加载时始终允许弹出窗口阻止程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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