1。打开窗口:
var handle = window.showModalDialog(url, objects, feathers);
其中:objects可以为参数(包括数组),也可以是对象。
通常的用法 objects = {window} ,把父窗体的对象共享给子窗体。
2。关闭子窗口:
window.close();
3。从子窗体传参数给父窗体:
window.returnVal = string;
3。清除缓存,防止模式窗口页面不更新的情况:
HTML
<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。防止打开新窗口(如提交表单):
<base target="_self">
5。在模式窗口使用F5刷
博客介绍了前端开发中一些实用操作。包括关闭子窗口的方法,从子窗体传参数给父窗体的操作,还给出了清除缓存防止模式窗口页面不更新的HTML、ASP、PHP、JSP代码示例,以及防止打开新窗口和在模式窗口使用F5刷新等内容。
119

被折叠的 条评论
为什么被折叠?



