iframe跨域高度自适应

<script charset="utf-8" type="text/javascript">
document.domain="aaa.com"
</script>

<iframe id="frm" src="bbb.php" frameborder="0" scrolling="no" width="960" height="800"></iframe>


bbb.php

<script charset="utf-8" type="text/javascript">
document.domain="aaa.com"
</script>

//适应高度

function SetHt(){

parent.document.getElementById('frm').style.height=document.body.clientHeight+'px';

}


你可能感兴趣的:(iframe跨域高度自适应)