js跨域获取页面内容高度
本地文件内有一段html:
<iframe src="http://www.xxx.com/index.aspx" id="sanwei" width="990px" scrolling="yes" frameborder="0" id="taobao" ></iframe>
//js获取http://www.xxx.com/index.aspx页面内容得高度
var hnght =0;//高度var win = document.getElementById("sanwei");if (win.contentDocument && win.contentDocument.body.offsetHeight){ hnght = win.contentDocument.body.offsetHeight;}else{ hnght = win.Document.body.scrollHeight;}alert(hnght);