window.close()不起作用了

来源:百度知道 编辑:UC知道 时间:2024/06/15 21:15:39
Page.RegisterStartupScript("", "<script>var a=window.showModalDialog('SetFilemoney.aspx','','Dialogwidth=280px;DialogHeight=138px;status:no;help:no');if(a == 1){window.close();}</script>");

哪位大哥大姐帮小着看一下这句话,在ASP.NET中这句话就是弹出一个小页面,然后关闭本页,但是能把小页面弹出来,可是关不了本页呀,后面的那个window.close()没有起作用。

Response.Write("<script>window.open('StudentChose.aspx','newwindow','menubar=1,titlebar=1,toolbar=1,status=1,scrollbars=1,resizable=1')</script>");

Page.RegisterStartupScript("", "<script>var a=window.showModalDialog('SetFilemoney.aspx','','Dialogwidth=280px;DialogHeight=138px;status:no;help:no');if(a == 1)window.close();</script>");

多了个括号。

火狐里面这个函数无效,除非你的火狐开启了某个安全设置