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

关闭一个window窗口实现刷新操作
当点击编辑时打开一个window窗口,现在想完成编辑之后,提交数据,当点击关闭或者直接关闭窗口的时候实现父页面的刷新,现在当点击关闭按钮的时候刷新已经实现,还没有实现的关闭窗口的时候的刷新
<body  onbeforeunload="Exit()">

function Exit()
 {
  if (event.clientX > document.body.clientWidth && event.clientY < 0||event.altkey){
   window.opener.location.reload();
  } 
 }

怎么实现不了,希望各位能帮忙解决一下,下面是我的代码:
<script>
function back() {

window.close();
window.opener.location.reload();
//window.opener.location.href=window.opener.location.href;
}
function Exit()
 {
  if (event.clientX > document.body.clientWidth && event.clientY < 0||event.altkey){
   window.opener.location.reload();
  } 
 }
</script>
<%
String appid = CString.getAttribute(request, "appid");
String appname = request.getParameter("appname");
String memo = request.getParameter("memo");
if ("true".equals(request.getParameter("operate"))) {
Connection con1 = null;
Statement sm = null;
DBPoolConnection DBpc = null;


try {
String sql = "update appinfo set appname='" + appname
+ "',memo='" + memo + "'  where appid='" + appid
+ "'";
DBpc = DBPoolConnection.getInstance();
con1 = DBpc.getConnection();
sm = con1.createStatement();
sm.executeUpdate(sql);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (sm != null) {
try {
sm.close();
} catch (SQLException e) {
}
}
if (con1 != null) {
try {
con1.close();
} catch (SQLException e) {
}
}
}
}
%>
<body  onbeforeunload="Exit()">
<form name="form1" action="editapp.jsp" method=post>
<fieldset>
<legend>
<b>编辑APP</b>&nbsp;&nbsp;
</legend>
<table border="0"
style="border-collapse: collapse; margin-left: 10px;"
bordercolor="#808080" cellpadding="0" width="100%">
<tr>
<td>
&nbsp;&nbsp;
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;
</td>
</tr>
<tr>
<td>
AppID:
</td>
<td>
<input class="txtcss" name="appid"
value="<%=CString.isNull(appid)%>" readonly type="text">
<font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;
</td>
</tr>
<tr>
<td>
App名称:
</td>
<td>
<input class="txtcss" name="appname" value=