模态窗口怎样刷新父窗口?

yf1975 2003-10-10 09:07:54
打开的使用window.showModalDialog("aaa.htm",window,"")
B页面放在aaa.htm内一个frame里,然后B提交给C
要刷新父窗口?
我用parent.dialogArguments.location.reload();
系统报错,说没有我用parent.dialogArguments.location.reload();
...全文
57 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yf1975 2003-10-10
  • 打赏
  • 举报
回复
我想在111.jsp页面刷新index.html页面
yf1975 2003-10-10
  • 打赏
  • 举报
回复
index.html
<body>
<input type=button onclick="window.showModalDialog('aaa.html',window)" value="open">
</body>

aaa.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时间选择</title>
<link href="../images/site.css" rel="stylesheet" type="text/css">
</head>
<frameset rows="0,*" frameborder="0" framespacing="0">
<frame src="no_page.jsp">
<frame src="bbb.jsp">
</frameset><noframes></noframes>
</html>

bb.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时间选择</title>
<link href="../images/site.css" rel="stylesheet" type="text/css">
</head>
<body class="bgcolor">
<form name="form1" method="post" action="111.jsp">
<table width="180" border="0" cellpadding="4" cellspacing="1" class="tablecolor">
<tr class="trcolor2">
<td>时间选择
<select name="hour">
<%
for(int i=0;i<24;i++){
%>
<option value="<%=i%>"><%=i%></option>
<%
}
%>
</select>

<select name="time">
<%
for(int i=0;i<60;i++){
%>
<option value="<%=i%>"><%=i%></option>
<%
}
%>
</select>
分</td>
</tr>
<tr class="trcolor2">
<td align="center"><input type="submit" name="Submit" value="提交" class="button">
<input type="button" name="Submit2" value="关闭" class="button" onClick="window.close();"></td>
</tr>
</table>
</form>
</body>
</html>
bbb.jsp 页面提交给111.jsp,刷新index.html
我试了
window.parent.dialogArguments.document.execCommand('Refresh');
还是不行
kingdomzhf 2003-10-10
  • 打赏
  • 举报
回复
index.html
<body>
<input type=button onclick="window.showModalDialog('aaa.html',window)" value="open">
</body>

aa.html
<body>
<iframe src='b.htm'></iframe>
</body>

b.htm
<body>
<input type=button value=refresh onclick="window.parent.dialogArguments.document.execCommand('Refresh');">
</body>
月光易水 2003-10-10
  • 打赏
  • 举报
回复
代码?

上述方法在win2000(ie5 or ie6)均无问题.



:_)
yf1975 2003-10-10
  • 打赏
  • 举报
回复
可以刷新了
但是我把showModalDialog用到我的函数中,调用就报错,不知道是为什么?
function OpenModa(URL,WIDTH,HEIGHT) {
var theDes='status:no;center:yes;help:no;minimize:yes;maximize:no;dialogWidth:'+WIDTH+'px;dialogHeight:'+HEIGHT+'px;scroll:no;';
window.showModalDialog(URL,window,theDes);
//window.showModelessDialog(URL,window,theDes);
}
孟子E章 2003-10-10
  • 打赏
  • 举报
回复
这样可以:

<input id=m>
<input onclick="window.showModalDialog('aaa.htm',window)" type="button" value="open">
<script>alert()</script>

aaa.htm
============
<script>
var s=window.dialogArguments
</script>
<body>
<input onclick="s.location.reload()" type=button value="reload">
孟子E章 2003-10-10
  • 打赏
  • 举报
回复
这样可以实现消息传递
<input id=m>
<input onclick="window.showModalDialog('aaa.htm',window)" type="button" value="open">

aaa.htm
==========
<script>
var s=window.dialogArguments
</script>
<body>
<input onclick="s.document.all.m.value='xxxxx'" type=button value="change">
孟子E章 2003-10-10
  • 打赏
  • 举报
回复
不能刷新父窗口
只能操作完了才进行刷新,
yf1975 2003-10-10
  • 打赏
  • 举报
回复
还是报错?
月光易水 2003-10-10
  • 打赏
  • 举报
回复
111.jsp
try:
<SCRIPT LANGUAGE="JavaScript">
<!--
function window.onload()
{
//parent.dialogArguments.location.reload();
window.parent.dialogArguments.document.execCommand('Refresh');
}
//-->
</SCRIPT>


:_)
yf1975 2003-10-10
  • 打赏
  • 举报
回复
是不是不能刷新父窗口?

87,902

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧