首页 新闻 会员 周边 捐助

window.showModalDialog奇怪问题

0
悬赏园豆:10 [已关闭问题]

父窗体<body runat ="server" id = "body1" >里使用以下JS弹出子窗体

form1.hidShowModalURLL是一个隐藏控件,存放后台动态赋值的URL字符串
                <script language="javascript" type="text/javascript">
                    var strhidShowModalURL="";
                    var strArr=new Array();
                    var strArrPa=new Array();
                    var strURL="";
                    var strSet="";
                    var strPopup="";
                    strhidShowModalURL = form1.hidShowModalURL.value;            

                    if (strhidShowModalURL!="")
                    {
                       
                        strArr= strhidShowModalURL.split(",");
                        strURL=strArr[0];
                        strSet=strArr[2];
                   
                        strArrPa=strArr[0].split("&");
                        strPopup=strArrPa[strArrPa.length -1];
                        if (strPopup=="popup=0")
                        {
                            location.href=strURL;
                        }
                        else
                        {
                            window.showModalDialog(strURL,window,strSet);
                            //window.dialogArguments.location.reload(true);
                        }
                        form1.hidShowModalURL.value="";   
                    }
                </script>

子窗体使用

Response.Write("<script language = 'javascript'>window.dialogArguments.location.reload(true);self.close();</script>")

关闭子窗体并刷新父窗体。

结果:

window.dialogArguments.location.reload(true);出错

但,父窗体使用<a href=javascript:window.showModalDialog('URL',window,'dialogHeight:500px;dialogWidth:600px;scroll:auto;;') style='text-decoration:none'>Start&nbsp</a>

弹出子窗体

window.dialogArguments.location.reload(true);self.close();却是正确的。为什么?

个人抽屉的主页 个人抽屉 | 初学一级 | 园豆:143
提问于:2009-10-22 11:17
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册