How to pass data to parent window from popup window?(如何将数据从弹出窗口传递到父窗口?)
问题描述
如何从弹出窗口传递一些数据或调用父窗口上的函数?
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()
这篇关于如何将数据从弹出窗口传递到父窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将数据从弹出窗口传递到父窗口?


- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06