1.同域
一:引入jquery
<script type="text/javascript" src="../jquery.min.js"></script>
二:设置iframe的src
<iframe src="http://localhost/mc/demo3.html" marginwidth="0" marginheight="0" width="100%" height="100%" id="iframe111" frameborder="0" scrolling="no" onload="reinitIframe()" ></iframe>
三:加载函数
function reinitIframe(){ var height = $('#iframe111').contents().find('body').height(); console.log(height); }