可以刷新了 但是我把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); }
<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>
<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');
还是不行
try:
<SCRIPT LANGUAGE="JavaScript">
<!--
function window.onload()
{
//parent.dialogArguments.location.reload();
window.parent.dialogArguments.document.execCommand('Refresh');
}
//-->
</SCRIPT>
:_)
<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">
<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">
但是我把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);
}