前提必须在同一基础域名下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>无标题文档</title>
</head>
<script language="javascript" type="text/javascript">
document.domain = "xxx.com";
function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
<body>
<iframe id="frame_content" src="http://www.xxxx.com/111.htm" scrolling="no" frameborder="0" οnlοad="this.height=100"></iframe>
</body>
</html>
111.html
加入 document.domain = "xxx.com"