I've been experiencing issues using postMessage
in Firefox and Internet Explorer, whilst Google Chrome has worked sound as a pound each time.
What I'm trying to do is use postMessage
from the iFrame to my parent with an action of closeForm
. The iFrame URL is a sub-domain of the parent, the iFrame source itself also has document.domain = document.domain
which I believe should have sorted my issues.
Currently the iFrame JavaScript is calling window.top.postMessage('closeForm', '*')
which as I've mentioned works a treat in Chrome, but in Firefox I get ReferenceError: window is undefined
so I changed window.top
to parent.postMessage
but I get get the same thing only with parent is not defined
.
The same thing doesn't work in IE9 either. Any suggestions?
window.parent
works for me in Firefox on OS X