使用 HTML5 解决方案传达打开的选项卡
这就是我需要的:我在浏览器中打开了一个index.html。我打开一个新窗口,例如 caller.html。当 caller.html 加载时,它会向 index.html 发送一条消息。
我怎样才能用html5做到这一点?我正在考虑 Sharedworkers 或 Postmessage,但我没有找到可以轻松实现此功能的演示或示例代码。
我不需要跨浏览器和后备解决方案。
Here is what i need: I have an index.html opened in my browser. I open a new window, for example, caller.html. When the caller.html loads in, it sends a message to the index.html.
How can i do this with html5? I thinking about Sharedworkers or Postmessage, but i didn't find a demo or sample code that i can easily implement to this feature.
I don't need crossbrowser and fallback solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MDN 有很好的文档和示例: https://developer.mozilla.org/en/DOM /window.postMessage
MDN has good documentation and an example: https://developer.mozilla.org/en/DOM/window.postMessage