简体   繁体   English

JavaScript弹出窗口,PHP

[英]Javascript popup, Php

I have a javascript popup and I am stuck with the below two things, 我有一个JavaScript弹出窗口,但我坚持以下两件事,

1) I want the parent html page to be updated once the popup page updates. 1)我希望父HTML页面在弹出页面更新后立即更新。

2) how can i close the popup when i click on cancel 2)单击取消时如何关闭弹出窗口

Implementation Sample : 实施示例:

http://www.gotit.co/pop_sample/test.php http://www.gotit.co/pop_sample/test.php

By what you showed me you could do two things 1. When the request is successful on the "frame" thats opened, You can use an AJAX call to refresh the content of the parent with a $.post or $.ajax method call. 通过向我展示的内容,您可以做两件事:1.在打开的“框架”上成功完成请求后,可以使用AJAX调用通过$ .post或$ .ajax方法调用来刷新父级的内容。

Also, you could, on success, just call parent.reload(); 同样,成功后,您可以只调用parent.reload();。 to refresh the entire page, but thats not as recommended. 刷新整个页面,但是那不是推荐的。

1)window.opener gives you the 'parent of your popup. 1)window.opener为您提供弹出式窗口的“父项”。 Just do reload or change location; 只需重新加载或更改位置即可;

2)to close popup: onclick event on your cancel button with javascript: window.close(); 2)使用javascript:window.close()关闭弹出窗口:onclick事件在您的取消按钮上;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM