hi nayen,
I did a little playing around with local files and I think the issue has more to do with waiting for the entire page to finish loading. Try this JavaScript on your page:
Code:
function getIframeDocHeight() {
'use strict';
var iframeDocHeight = document.getElementById('myiframe').contentWindow.document.getElementsByTagName('body')[0].scrollHeight;
return console.log(iframeDocHeight);
}
window.onload = getIframeDocHeight;
You can also use this value instead for iframeDocHeight:
Code:
var iframeDocHeight = document.getElementById('myiframe').contentDocument.body.scrollHeight;
Hope this helps.
Bookmarks