Within an iFrame, we need to get the parent's window/document height.
Is there a way to get this using jQuery?
I know we can use $(document).height()
to get a page's height. I just can't figure out how to get the parent's value from within the iFrame.
Sending data from child iframe to parent window : Whenever you embed an iframe, the iframe will have a reference to the parent window. You just need to use the PostMessage API to send data via the window. parent reference of the parent window.
jQuery is not needed.
parent.document.body.clientHeight
That works for me with IE7 and FF3.
In jQuery you can do
$(parent.window).width();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With