我已經使用以下代碼來增加iframe
高度。此代碼在Mozilla和IE中正常工作,但在Google Chrome中無法正常工作。增加iframe高度的代碼無法在Google Chrome中工作
<script type="text/javascript">
function calcHeight()
{
the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
document.getElementById('the_iframe').height = the_height + 35;
}
</script>
<iframe src="indexframe.html" id="the_iframe" onLoad="calcHeight();" name="home_frame" width="100%" frameborder="0" ></iframe>
你在Chrome的JavaSc中發現任何錯誤ript控制檯(F12 - > Chrome中的控制檯)? –