<!-- 經(jīng)過幾個小時的努力,終于找到解決問題的方法。 -->
<!-- 以下代碼可實現(xiàn): -->
<!-- 在母窗口內(nèi)的頁面點擊打開一個定制的新窗口,同時將母窗口關(guān)閉,而且不出現(xiàn)任何提示。 -->
<html>
<head>
<title>百變窗口</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- openmain()函數(shù)打開定制的窗口 -->
<script language="javascript">
<!--
function openmain(){window.open("index1.htm","mainwindow","width=500,height=400,status=no,location=no,toolbar=no,directories=no,menubar=no,left=150,top=50");}
// -->
</script>
</head>
<body>
<!-- 無提示關(guān)閉窗口的源碼 -->
<object id=parentwindow type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
<!-- 點擊鏈接后: -->
<!-- openmain()打開新窗口 -->
<!-- parentwindow.focus()聚焦母窗口 -->
<!-- parentwindow.Click()關(guān)閉母窗口 -->
<a href="#" onClick="javascript:openmain();parentwindow.focus();parentwindow.Click();">打開新窗口,并關(guān)閉此窗口</a>
</body>
</html>
子窗口刷新主窗口
<!-- 經(jīng)過幾個小時的努力,終于找到解決問題的方法。 -->
<!-- 以下代碼可實現(xiàn): -->
<!-- 在母窗口內(nèi)的頁面點擊打開一個定制的新窗口,同時將母窗口關(guān)閉,而且不出現(xiàn)任何提示。 -->
<html>
<head>
<title>百變窗口</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- openmain()函數(shù)打開定制的窗口 -->
<script language="javascript">
<!--
function openmain(){window.open("index1.htm","mainwindow","width=500,height=400,status=no,location=no,toolbar=no,directories=no,menubar=no,left=150,top=50");}
// -->
</script>
</head>
<body>
<!-- 無提示關(guān)閉窗口的源碼 -->
<object id=parentwindow type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
<!-- 點擊鏈接后: -->
<!-- openmain()打開新窗口 -->
<!-- parentwindow.focus()聚焦母窗口 -->
<!-- parentwindow.Click()關(guān)閉母窗口 -->
<a href="#" onClick="javascript:openmain();parentwindow.focus();parentwindow.Click();">打開新窗口,并關(guān)閉此窗口</a>
</body>
</html>
子窗口刷新主窗口
<a href=# onclick=window.opener.document.location.reload();>refresh opener</a>
關(guān)閉子窗口刷新主窗口
<script>
function op(){
newopen=window.open("a.htm","0","0");
setInterval(‘wen()‘,10);
}
function wen(){
if(newopen.closed){
window.location.reload();
}
}
</script>
<span style="CURSOR: hand" onclick=‘op()‘><a href="#">填寫新的留言</a></span>
全屏
<script language="javascript">
<!--
window.open("youfile","","fullscreen=1,menubar=no")
//-->
</script>