引用:Dialog.js文件,弹出窗口单独运行的时候正常,嵌入frameset中就提示:var bgdiv = pw.$("_DialogBGDiv"); 对象不支持此属性方法

解决方案 »

  1.   

    光这样看是无法解释出来的了,最好上代码以及使用什么框架,还有是在什么时候执行上面那段代码都解释清楚。。一般来说遇到这种情况就需要考虑清楚IE里iframe其他网页会改变被嵌入网页的dom,你从这个角度去考虑问题试试看吧。
      

  2.   

    这是:引用的JS文件:http://www.websjy.com/club/websjy_index/41/Dialog.js
    html引用这个文件,调用里面的函数,弹出窗口。
    如果单独运行这个页面完全可以,但是把这个页面嵌入到framset中,就是提示js错误。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>浏览器)</title>
    <style>
    body {background: #ffffff; color: #444;}
    a{ color: #09d; text-decoration: none; border: 0; background-color: transparent;}
    body,div,q,iframe,form,h5{ margin: 0; padding: 0;}
    img,fieldset { border: none 0; }
    body,td,textarea { word-break: break-all; word-wrap: break-word; line-height:1.5;}
    body,input,textarea,select,button { margin: 0; font-size: 12px; font-family: Tahoma, SimSun, sans-serif;}
    div,p,table,th,td { font-size:1em; font-family:inherit; line-height:inherit;}
    h5{ font-size:12px;}
    </style>
    <script type="text/javascript" src="http://www.websjy.com/club/websjy_index/41/Dialog.js"></script>
    <script type="text/javascript">
    function zOpen(){
    var diag = new Dialog("Diag2");
    diag.Width = 900;
    diag.Height = 400;
    diag.Title = "弹出窗口示例";
    diag.URL = "http://www.16sucai.com/";
    diag.OKEvent = zAlert;//点击确定后调用的方法
    diag.show();
    }
    function zAlert(){
    Dialog.alert("你点击了一个按钮");
    }
    function zConfirm(){
    Dialog.confirm('警告:您确认要XXOO吗?',function(){Dialog.alert("yeah,周末到了,正是好时候");});
    }function al()
    {
    alert(top.location);
    }
    </script>
    </head>
    <body>
    <input type="button" value="弹出新窗口" onclick="zOpen()" />
    </body>
    </html>
    等待解决啊,急死了
      

  3.   

    pw.$
    pw 是什么东西
    $哪来的自己调试一下
      

  4.   

    zOpen() 函数里面的写法是不是有问题,你测测
      

  5.   

    用firebug看看哪一步走不下去了
      

  6.   

    就是到:
    var bgdiv = pw.$("_DialogBGDiv"); 报:对象不支持此属性方法错误
      

  7.   

    $E.getTopLevelWindow = function(){
    var pw = window;
    while(pw!=pw.parent){//如果存在框架  则获取顶层框架的WINDOW对象
    pw = pw.parent;
    }
    return pw;
    }Dialog.prototype.show = function(){
    var pw = $E.getTopLevelWindow();//存在框架  PW是顶层框架的WINDOW对象var bgdiv = pw.$("_DialogBGDiv");//顶层框架页面没有加载这个脚本文件  所以不存在$方法,所以报错不知道为什么这么写  我没看懂