關閉視窗
有出現是否要關閉,確認後關閉。
.按鈕形式 <input type="button" VALUE="關閉視窗" onClick="window.close()">
.文字形式 <a href="#"onclick="window.close()">關閉視窗</a>
不出現是否要關閉,直接關閉。
.寫在head
<script language="JavaScript" type="text/JavaScript">
<!--
function closewin(){
window.setTimeout('window.opener=null;closeme()',0);
}
function closeme(){
top.close();
}
//-->
</script>
.寫在body
<a href="#"onclick="closewin()">關閉視窗</a>