其中:objects可以爲參數(包括數組),也可以是對象。
通常的用法 objects = {window} ,把父窗體的對象共享給子窗體。
2。關閉子窗口:
3。從子窗體傳參數給父窗體:
3。清除緩存,防止模式窗口頁面不更新的情況:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Mon, 23 Jan 1978 20:52:30 GMT">
ASP
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
%>
PHP
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
JSP
response.setHeader("Pragma","No-Cache");
response.setHeader("Cache-Control","No-Cache");
response.setDateHeader("Expires", 0);
4。防止打開新窗口(如提交表單):
5。在模式窗口使用F5刷新頁面:
<body οnkeydοwn="if (event.keyCode==116){reload.click()}">
<a id="reload" href="filename.htm" style="display:none">reload...</a>
其中:filename爲窗口頁面。
6。防止模式窗口打開的頁面出現cookie丟失的情況:
模式窗口打開新窗口時,僅可以使用 showModalDialog(url,window,feathers); 方法,且 objects 爲 window 。
7。在彈出窗口中獲得或設置主窗口的任何值:
打開彈出窗口時用:showModalDialog(url, window, feathers)
在彈出窗口中使用 window.dialogArguments 對象(即主窗口傳遞過來的 window 對象集),即可以獲得或者設置主窗口的值。