日期:2014-05-16  浏览次数:20696 次

请问一个打开自适应子窗体,关闭子窗体刷新父窗体的问题
希望是这样的步骤:
1.父窗a打开自适应大小的子窗体b(表单)
2.提交给c窗体做表单提交后的操作
3.关闭子窗口刷新父窗体
但是现在提交表单后后不能关闭子窗口了,又返回到b.asp的子窗口页面了请问各位该怎么解决?
代码
父窗a.asp
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName) { //v2.0
  window.open(theURL,winName,"width=100,height=100,top=100")
}
//-->
</script>
<body>
<a href="#" onclick="MM_openBrWindow('b.asp?cz=addsort','')">添加</a>
</body>
 子窗口b.asp
<script language=javascript>

//
function win_onLoad(){
  var width = document.all["classformthtml"].offsetWidth;  
  var height = document.all["classformthtml"].offsetHeight; 
   
  width = eval(width + 18);
  height = eval(height +80);
   
  if (width < 200)
  width = 200;
  else if (width > screen.width)
  width = screen.width;
   
  if (height < 200)
  height = 200;
  else if (height > screen.height)
  height = screen.height;
   
  window.resizeTo(width,height);
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="win_onLoad();">

<table border="0" cellspacing="0" cellpadding="5" id="classformthtml">
<form name="form_edit" method="post" action="c.asp">
<tr>
<td colspan="2" align="center" class=top_1><%=top%></td>
</tr>
<tr>
<td align="right">名称:</td><td align="left"><input type="text" name="jz_name" id="classtitle" value="<%=jz_name%>" /></td></tr>
 
<tr><td colspan="2" align="center"><input type="submit" id="Submit1" value="提 交" class="wndbutton" /> <input type="reset" value="重 置" class="wndbutton" /></td></tr>
</form>
</table>
</body>
子窗口c.asp
<script>alert('提交成功');opener.location.reload();window.close();</script>



------解决方案--------------------