Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用HTML5解决方案与打开的选项卡通信_Javascript_Html_Postmessage - Fatal编程技术网

Javascript 使用HTML5解决方案与打开的选项卡通信

Javascript 使用HTML5解决方案与打开的选项卡通信,javascript,html,postmessage,Javascript,Html,Postmessage,我需要的是:我在浏览器中打开了index.html。我打开一个新窗口,例如caller.html。加载caller.html时,它会向index.html发送一条消息 我如何使用html5实现这一点?我在考虑Sharedworkers或Postmessage,但我没有找到一个可以轻松实现此功能的演示或示例代码 我不需要交叉浏览器和回退解决方案。MDN有很好的文档和示例:这不是我真正想要的。仅当caller.html是index.html文件(iframe,弹出窗口)的子文件时,它才起作用

我需要的是:我在浏览器中打开了index.html。我打开一个新窗口,例如caller.html。加载caller.html时,它会向index.html发送一条消息

我如何使用html5实现这一点?我在考虑Sharedworkers或Postmessage,但我没有找到一个可以轻松实现此功能的演示或示例代码


我不需要交叉浏览器和回退解决方案。

MDN有很好的文档和示例:

这不是我真正想要的。仅当caller.html是index.html文件(iframe,弹出窗口)的子文件时,它才起作用