弹出窗口与同一域的另一个窗口之间的跨窗口js交互
我正在尝试从 example.com 的窗口 a
打开一个弹出窗口。然后关闭窗口 a
并在同一域 (example.com) 中打开另一个窗口 b
。是否可以从窗口b
访问窗口a
的DOM以及如何访问?
打开弹出窗口,
window.open('http://example.com/blah', 'somename', settings..),
通过使用不同的 url(如下所示)从窗口 b
执行相同的操作,可以从窗口 a
window.open("http://example.com/blah2", "somename" ...)
这似乎表明窗口是通过窗口名称访问的。但我找不到任何方法来访问带有或不带有窗口名称的弹出窗口的 DOM。我该怎么做?
I'm trying to open a popup from window a
at example.com. then close window a
and open another window b
at the same domain (example.com). Is it possible to access the DOM of window a
from window b
and how?
The popup is opened from window a
by
window.open('http://example.com/blah', 'somename', settings..),
Executing the same from window b
with a different url (shown below) works
window.open("http://example.com/blah2", "somename" ...)
This seems to suggest windows are accessed by window name. But I could not find any way to access to DOM of the popup with or without the window's name. How would I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试类似的东西
Try something like