Window to Window Communication in js by window name

淺唱寂寞╮ 提交于 2019-12-01 20:55:11

assuming the following:

windowHandle=window.open('path/to/document');

you can interact between both windows.

You have a pointer to the window-object from the document where it was opened from using the variable-name:

//doSomething has to be known inside the new window
windowHandle.doSomething();

and from the document inside the new window to the window that opened the new window, using the opener-property:

//doSomething has to be known inside the window that opened the new window
opener.doSomething();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!