处理邮政邮政时处理javascript iframe down案例
我正在尝试处理 iframe 是我的react js应用程序中的情况下,
我正在对iframe进行postmessages,如this iframe.contentwindow.postmessage(mesage,emort);
有时iframe有时原点可能会出于某些原因,我想处理此部分,在控制台中,我得到这个错误
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('localhost') does not match the recipient window's origin ('null').
问题是我该如何捕获它? iframe可以加载,一切都可以了,但是x分钟后,它可以关闭,如何捕获此错误?任何想法都将不胜感激
I am trying to handle iframe is down case on my react js application
I am doing postMessages to the iframe like this iframe.contentWindow.postMessage(mesage, origin);
Sometimes iframe origin can be down , with some reasons , I want to handle this part , in the console , I am get this error
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('localhost') does not match the recipient window's origin ('null').
Question is how can I catch it ? Iframe can be load and everything can be fine , but after x minute it can be down , how to catch this error ? any ideas will be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论