根据我对其他答案的评论,您只需要处理该
window.onunload事件并使用该
window.opener属性即可告诉调用页面刷新。
2.add.jsp
<html><head> <script type="text/javascript"> //ADDED START window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); } //ADDED END $(document).ready(function(){ $("#savebtn").click(function(e) { $.ajax({ type: "POST", url: "RecordHandler", data: dataString, success: function(data){ $('body').html(data); $('#msg').html('New Record Added Successfully.'); window.timeout(CloseMe, 1000); <-- not sure on the syntax but have a timeout which triggers an event to close the form once a success has been handled. Probably should do something incase of an error. } }); return false; <-- this should stop the window from unloading. }); function CloseMe() { window.opener.location.reload(); window.close(); } </head>


