怎样在设置按下关闭立即关闭窗口呢?

一般在一个按扭上使用关闭窗口事件(

1<input name="Button" onclick="window.close()" type="button" value="关闭窗口"/>

)时,在按下按扭后都会弹出一个对话框询问是否要关闭窗口,我现在想按下这个按扭后不弹出询问的对话框而直接关闭这个窗口,可以怎样做呢?
---------------------------------------------------------------

onClick="window.opener=null;window.close();"

---------------------------------------------------------------

楼上 tacchan(tacchan)的方法不错啊!你可以试一下!我一直也用这种方法,但这种方法只能关闭当前窗口噢!如果你想关闭父窗口,要用FOCUS方法得到父窗口,然后再关闭才可;

 1<html><head><title>test</title>
 2<script language="jscript">   
 3function closewin()   
 4{   
 5document.open("test.htm","","fullscreen");   
 6window.opener.focus();   
 7window.opener=null;   
 8window.close();   
 9}   
10</script>
11</head>
12<body>
13<input onclick="closewin()" type="button" value="关闭上一级窗口"/>
14</body>
15</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus