//简单弹窗类
function openChildFrame(strUrl, strTitle, strWidth, strHeight, isScrollbar) {
    var iheight = strHeight;
    var iwidth = strWidth;
    var ileft = (screen.width - iwidth) / 2;
    var itop = (screen.height - iheight) / 2;
    var iscrollbar = isScrollbar;
    if (iscrollbar == null || iscrollbar == "") iscrollbar = "no";
    var feature = "left=" + ileft + ",top=" + itop + ",fullscreen=0,width=" + iwidth + ",height=" + iheight + ",toolbar=no,menubar=no,scrollbars=" + iscrollbar;
    feature += ",resizable=no,location=no,status=yes,dialog=yes";
    var strWindow = window.open(strUrl, strTitle, feature);
    return strWindow;
}

解决方案 »

  1.   

    不是不执行,是被拦截掉了。
    试试这个:<!doctype html>
    <html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.js"></script>
    </head>
    <body>
    <script type="text/javascript">
        $(function(){
            window.showModalDialog('http://www.baidu.com')
        });
    </script>
    </body>
    </html>
      

  2.   

    1、确认你已加载了 jQuery
    2、window.open("http://www.baidu.com");
    3、检查你的浏览器是否设置了拦截弹出式窗口
      

  3.   

    Hi jikeytang,我刚测试了一下,还是不行。我的浏览器是Chrome. 感谢大家的回复.