在地址栏中输入url时需要检测浏览器中的pop阻止程序 [英] need to detect the pop blocker in the browser while entering url in the address bar

查看:115
本文介绍了在地址栏中输入url时需要检测浏览器中的pop阻止程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

am使用以下代码在浏览器中检测弹出窗口阻止程序

am using this following code to detect the pop blocker in the browser

function popup_blocked() {
            var popup = window.open('', '_blank', 'toolbar=no,scrollbars=no');
            if (!popup) {
                return true;
            } else {
                popup.close();
                return false;
            }
        }

        if (popup_blocked()) {
            alert('Popup blocker detected.');
        }



1.问题是它在Safari浏览器中能否完美运行,但即使在IE中也无法正常运行,
2.我正在使用aspx页面上的javascript来导航页面,但它不起作用



1. question is its perfectly working in safari browser, but it not working in other even in IE,
2. Am using javascript on aspx page to navigate page but its not working

function RedirectPage() {
            if (popup_blocked()) {
                alert('Popup blocker detected.');
            }
            location.href("frmlogin.aspx");
            return false;
        }



3.在.cs页面中,我正在使用以下代码



3. In .cs page am using this following code

private void Page_Load(object sender, System.EventArgs e)
       {
           lnkbtnredirectlogin.Attributes.Add("onclick", "return RedirectPage()");
       }



请为我建议一个正确的替代方法来解决此问题.

谢谢
Sathya



Please suggest me a correct alternative to make work of this.

Thx
Sathya

推荐答案

引用该线程
http://www.jguru.com/faq/view.jsp?EID=1157429 [ ^ ]
Refer this thread
http://www.jguru.com/faq/view.jsp?EID=1157429[^]


这篇关于在地址栏中输入url时需要检测浏览器中的pop阻止程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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