iframe高度自适应(同域情况)

主页面main.jsp,iframe要设置一个默认高度,防止在chrome打开的iframe高度出现一直增加的情况

<body>
 <iframe name=openFrame  id="openFrame" scrolling="no" frameborder="no" border="0" class="app-frame" src="/www/com/yc"  onLoad="openLoad(this)" style="height:200px;"></iframe>
</body>
function openLoad(ifm){
     ifm.style.height=$(ifm).contents().outerHeight()+"px"; 
}
原文地址:https://www.cnblogs.com/miharu/p/5126248.html