What is the best way to determine the iframe
DOM element a page is being displayed in ?
I need to notify the parent window when the iframe's contents have really finished loading (iframe onload
looks like a scam with WebKit).
Consider the following scenario:
Suggestions on alternative solutions to this inter-frame communication are also welcome.
One problem I faced was that Safari / Chrome / WebKit browsers apparently fire the iframe's onload
event too early – I tried sending form data (with file upload) to an iframe and had the onload
handler clear the <input type="file" />
element's value and destroy the iframe, causing the form submission to be aborted, so I cannot use onload
in that case (btw, is that a feature or a bug ?).
Another use case is where the iframe does something and wants interact with the parent.
Like Stefaan id say window.parent
but you should check window.frameElement too.