jquery - 使用 jQuery 从子窗口调用父窗口函数的问题?
问题描述
我打开一个这样的窗口:
var impressionWindow = window.open('index.php?module=Products&src_module=Oneidsousjob&src_field=sousjob_article&src_record=&view=Popup&triggerEventName=postSelection', 'Popup', 'scrollbars=1,resizable=1,height=560,width=770');
我尝试使用以下代码在父窗口中调用一个函数:
window.opener.postSelection();
但是子窗口说: Uncaught TypeError: window.opener.postSelection is not a function
我不知道为什么我会尝试其他方式,比如这些:
window.parent.postSelection();
结果是相同的 postSelection 不是一个函数或者是这样的事件:
window.parent.$(window.parent.document).trigger('postSelection');
没有任何事情发生......
布雷夫我需要一些帮助,非常感谢提前...
解决方案
推荐阅读
- angular - PWA 离线谷歌分析
- python - 事件驱动环境中的 Python Turtle `While True`
- flutter - 如何自动对功能和自定义小部件进行分组?
- ios - UITableview 单元格阴影未出现在 ios 13 中
- ionic-framework - ionic5 发布后创建 ionic4 项目
- php - 当我使用 Ajax 调用时,选择选择器不显示
- c++ - 如何将数据存储到动态数组中
- php - 在 Laravel 中处理多个 smtps 的入站邮件(接收电子邮件)
- android - 列表视图中的颤振列表视图不滚动
- python-3.x - AttributeError:“NoneType”对象没有“读取”属性。如何解决此错误?