I'm looking for a way to postMessage to a sibling iFrame without any javascript in the parent page. The difficulty I'm having is trying to get the window object for the other iFrame from the first iFrame
The page would be laid out something like this:
html body (http://host.com/)
iFrame#a (http://me.com/a)
iFrame#b (http://me.com/b)
From iFrame#a
I'm trying to do:
(iFrame#b window).postMessage(...)
The problem is I don't know how to get the window object for iFrame#b
from within iFrame#a
. parent.getElementById()
and other functions are subject to XSS restrictions. I just want to emit a postMessage
to all other iFrames on the parent page that are from my domain http://me.com/
in the example above.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…