如何将数据从弹出窗口传递到父窗口? [英] How to pass data to parent window from popup window?

查看:21
本文介绍了如何将数据从弹出窗口传递到父窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从弹出窗口传递一些数据或调用父窗口上的函数?

How can I pass some data or call a function on the parent window from a popup window?

用户将单击一个链接,该链接将在同一网站上打开一个弹出窗口,一旦他完成弹出窗口,我希望它将新数据发送回父窗口,或调用父窗口上的函数.

The user will click a link which will open a popup on the same website, once he is finished with the popup, I want it to send the new data back to the parent window, or call a function on the parent window.

推荐答案

window.opener 对象是您要查找的对象,在弹出窗口中使用它来调用父窗口的 a 函数:

The window.opener object is what you're looking for, used it from within your popup like so to call the a function of the parent window:

window.opener.yourFunc() 

这篇关于如何将数据从弹出窗口传递到父窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆