让iframe根据里面的内容自适应宽度、高度。
<script>
function iframe_resize()
{
document.getElementById("mainFrm").style.height = mainFrm.document.body.scrollHeight;
document.getElementById("mainFrm").style.width = mainFrm.document.body.scrollWidth;
}
</script>
<iframe id="mainFrm" name="mainFrm" width="100"
frameborder="0" height="200" src="index/index/index2.jsp" onload="iframe_resize();"></iframe>