简略iframe高度自适应代码

简单iframe高度自适应代码1 js函数function adjustFrameHeight(obj) {var doc obj.document||obj.conten

简单iframe高度自适应代码
1 js函数

function adjustFrameHeight(obj) {     var doc = obj.document||obj.contentWindow.document;     obj.height=doc.documentElement.scrollHeight;}


2 html代码样例
 
<iframe src="url" onload="adjustFrameHeight(this);"></iframe>


以上代码兼容ie,firefox