1
我遇到了Safari问题,特别是没有从父窗口找到window.opener函数。我打电话的功能在Chrome和Firefox中运行良好。有没有人有任何提示?具有自定义功能的window.opener在Safari中不起作用
窗口1(父)
打开窗口2具有以下:
window.open(requestUrl, "_blank", "width=440, height=500, scrollbars");
窗口2(弹出)
请求URL页面返回后,以下被叫:
window.parent.opener.callBackIntegrationCompleted("testing");
window.close();
我得到以下错误的第一行:
TypeError: undefined is not a function (evaluating 'window.parent.opener.callBackIntegrationCompleted("testing")')
注:我试过window.opener,parent.window.opener和window.parent.opener的一些变化。
窗口1(父)回调
是打开的弹出具有以下的JS函数,但它从来没有得到这一点原来的父窗口。
function callBackIntegrationCompleted(code) {
console.log("got here");
}
太棒了! window.callBackIntegrationCompleted = callBackIntegrationCompleted;正是我所需要的。 – CaptCheech