我使用的是在我的HTML(PHP(中作为iFrame解决方案集成的第三部分工具。(制造商的建议(。
<iframe id="theIframe" src="manufacture.com"> </ iframe>
使用登录屏幕构建了一个弹出窗口并将其重定向到新的弹出窗口。任何人都有想法,我如何获得所有弹出窗口的所有事件。我需要登录屏幕或它们的关闭事件的参考。
我如何检查或捕获此事件。
iframe发射的POP将被重定向到第二个弹出窗口(无论出于何种原因(,并且不会将第二个弹出窗口绑定到iframe,也不会绑定到事件。
if (window.attachEvent) {
window.attachEvent("onmessage", receiveMessage);
} else {
console.log("event message added");
window.addEventListener("message", receiveMessage, false);
}
function receiveMessage(event) {
//capture the event for closing the second popup
console.log(event);
alert("User has closed the window in the iFrame");
//Close iFrame
var iframe = document.getElementById('theIframe');
iframe.parentNode.removeChild(iframe);
}
}
简而言之,问题并不是真正的问题。
没有解决此问题的解决方案。我将第二个POP的URL直接集成到IFRAME中。有时解决方案是如此接近。
有时它只是有助于重新考虑问题。