When the main Window wants to send a message to the child iframe -
It sets the child iframe url to its current url + hash (which represents the data).
But how does an iframe get new data?
We have 4 options: (I'm not talking about the new api eg postMessaage api and XDM libraries)
The child will poll the new hash (setTimeout)
In the main window, you can resize the iframe (iframe must register onResize )
OnHashChange event can be used in iframe
Destroying / creating an Iframe proxy that uses "onload" to send msg (javascript function!) To "SameDomainIframe" via parent.frames['samedonain'].sendData(...)
Here is my question: (regarding option # 2 (resize)):
According to this article:
In Firefox, Opera, Google Chrome, and Safari, the onresize event fires only when the browser window is resized. In Internet Explorer, the onresize event is fired when the browser size of the window or item.
Question:
Is there any cross-browser solution for this thing?
I do not need a situation where the user resizes the browser, and the iframe will re-read the data!
I want the data to be read only when I send a message in an iframe and manually resize it
javascript jquery cross-browser cross-domain iframe
Royi Namir Oct 05 '13 at 7:51
source share