Iframe onload triggers before content has fully loaded-help!
Posted: Wed Dec 30, 2009 12:55 pm
I have searched the web and found many people with the same problem but no solution that works.
I have an Iframe containing cross-domain content and I have a resize function that resizes the frame using height and width property of the iframe content. However, onload triggers the resize function too early, before all the content has loaded inside the frame so the frame is resized to the wrong size. I have tried using readyState, ready, (iframe object).onload = somefunction, so on and so forth. My code works if I use the setTimeout function to delay the resize, however the loading time varies across browser and servers and personal bandwidth (probably) and so I am looking for away I could find out when the content in my iframe has FULLY loaded into the frame.
I have an Iframe containing cross-domain content and I have a resize function that resizes the frame using height and width property of the iframe content. However, onload triggers the resize function too early, before all the content has loaded inside the frame so the frame is resized to the wrong size. I have tried using readyState, ready, (iframe object).onload = somefunction, so on and so forth. My code works if I use the setTimeout function to delay the resize, however the loading time varies across browser and servers and personal bandwidth (probably) and so I am looking for away I could find out when the content in my iframe has FULLY loaded into the frame.