即使打开弹出窗口阻止程序,如何打开一个新窗口 [英] How to Open a New Window Even if the Pop-up Blocker Is Turned On

查看:104
本文介绍了即使打开弹出窗口阻止程序,如何打开一个新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

我使用以下代码在java脚本中打开一个新页面,但是Web浏览器正在发出弹出窗口阻止程序的警告



Hello All,
I am using the following code to open a new page in java script but web browsers are giving the warning of pop-up blocker

<script language="javascript" type="text/javascript">
        function showPDF() {
            var popUp = window.open("PDFContainer.aspx", '_blank');
            return (popup)?false:true;
        }
    </script>





如果有弹出窗口阻止警告,如何在新窗口中打开页面(不允许手动) popup blocker)



How to open a page in new window if pop up blocker warning is there(not to allow manually popup blocker)

推荐答案

这是一个类型的问题:不允许做X.如何做X? :-)



如果一个弹出窗口阻止程序允许你弹出一个弹出窗口,那将是一个非常糟糕的阻止程序,人们不会使用它。



请理解弹出窗口阻止程序始终领先于您:它使用具体Web浏览器的界面,后者又可以完全控制客户端的所有渲染和脚本。并且您的应用程序应该适用于所有类型的HTTP客户端软件,并且可以从中略微抽象出来。从这一点开始,很容易理解,阻止程序阻止你的代码然后打破阻塞就容易得多。



-SA
This is a question of the type: "Doing X is not allowed. How to do X?" :-)

If a popup blocker allowed you to do a popup, it would be a very bad blocker, and people would not use it.

Please understand that a popup blocker is always a step ahead of you: it uses interface to a concrete Web browser which in turn take a total control of all rendering and scripting on the client side. And your application is supposed to work with all kinds of HTTP client software and be somewhat abstracted from it. From this point, it's easy to understand that it's much easier for a blocker to block your code then break this blocking.

—SA


谢谢谢尔盖说的。这就是拥有弹出窗口拦截器的重点!为什么不打开类似jquery ui对话框的东西?



http:// jqueryui。 com / dialog / [ ^ ]
I second what Sergey said. That's the whole point of having a popup blocker! Why not just open something like a jquery ui dialog ?

http://jqueryui.com/dialog/[^]

答案很简单,你不能。



想象一下你在浏览器上打开一个弹出窗口阻止程序,一些恶意用户仍然可以当你浏览一个网站时打开一个弹出窗口 - 打败弹出窗口拦截器的整个想法,不是吗。
The answer is as simple as "no you cant".

Imagine you turn on a popup blocker on your browser and some malicious users is still able to open a popup when you are browsing a site - beats the whole idea of a popup blocker, doesn't it.


这篇关于即使打开弹出窗口阻止程序,如何打开一个新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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