日期:2014-05-17  浏览次数:21193 次

打开子窗口修改,并刷新父窗口?
用win.open打开子窗口,进行数据方面的修改,怎么样做到修改后,关闭子窗口,并刷新父窗口呢/谢谢!

------解决方案--------------------
下面是一个例子。不过,你这样做,要注意如果主窗口在此前有提交、删除、...等操作

main.asp
-----------------------

<html>

<head>
<title> 主窗口,以读当前客户端时间模仿读服务端数据库,其实是一样的 </title>
</head>

<body>

<p> 当前时间: <%=Now()%>
</p>

<p>
<input type= "button " value= "打开窗口 " name= "B1 " onclick= "window.open( 'ChildWnd.asp ', 'NewWin ', 'status=yes, height=200, width=400 ') ">
</p>

</body>

</html>

--------------------------------------------


ChildWnd.asp
-------------------------

<html>

<head>
<title> 弹出的子窗口, 弹出后请关闭 </title>
</head>

<body OnUnload= "window.opener.location.reload(); ">
关闭吧, 假设已经修改了数据( 时间已经变化了 )
</body>

</html>