javascript - How to close the child page and refresh the parent page in the iframe framework
高洛峰
高洛峰 2017-05-16 13:11:05
0
4
614

Something like this

Close the current article and refresh the previous page

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(4)
滿天的星座

I can’t see where you used iframe and structure, can you explain it more clearly?
If you close the iframe and refresh the page, you can do it directly through the dom. If it is a different domain, you can do it through cross-domain.
If you close this tab and refresh another tab, you can use cookie + timing, or storage event to trigger multi-tab communication.

Ty80

postmessage is very suitable for this scene

伊谢尔伦

Try the js callback function

我想大声告诉你

This screenshot looks a lot like the H-ui framework.
If the iframe you pop up uses layui, you can use it like this:

var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);//关闭当前页
window.parent.location.replace(location.href)//刷新父级页面

If it pops up using layui:

window.close();//关闭当前页
window.parent.location.replace(location.href)//刷新父级页面

Inside this... window.close();//This close can actually be used universally

window.pranet.Operation();
This method is also common for operating the parent page. What follows is the same as what you want to do on the parent page

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template