IFrame is designed to be resized according to its content and it works on most browser but only in Mozilla Firefox, ONLY the first load is working but loading event afterwards is not working.
To let it works again, need to refresh the page or either clear the cache of the browser first..
The code is as below:
function sizeIFrame() {
var subscriptionFrame = jQuery("#subscriptionFrame");
var innerDoc = (subscriptionFrame.get(0).contentDocument) ?subscriptionFrame.get(0).contentDocument : subscriptionFrame.get(0).contentWindow.document;
subscriptionFrame.height(innerDoc.body.scrollHeight); }
<iframe id="subscriptionFrame" onload="sizeIFrame();"></iframe>
Anyone have idea about this?
Fixed! Solution as below:
This is because Firefox load the iframe content from the cache instead of the server. So xxx.location.reload(true) will force the iframe content to load from cache. Hopes it helps u guys! =)