iframe自动高度

<script>
//设置iframe自动高度
function setIframe(id){
var fn = function(){
try{
var iframe = typeof id=='string'?document.getElementById(id):id;
var height = iframe.contentWindow.document.body.scrollHeight;
iframe.height = height;
}catch (ex){};
};
setInterval(fn,200);
}
setIframe('myIframe');
</script>
原文地址:https://www.cnblogs.com/windly/p/5970373.html