首页 新闻 会员 周边

iframe 跨域自适应高度???

0
悬赏园豆:10 [待解决问题]

我项目有一个页面a.aspx,里面有一个iframe

嵌入假如是这个网址:http://q.cnblogs.com/

<iframe id="cwin" src="http://q.cnblogs.com/" scrolling="no" height="100%"  frameborder="1" marginheight="0" marginwidth="0"></iframe>

上面地址的高度怎么获取,求大牛来解决

js
walleyekneel的主页 walleyekneel | 菜鸟二级 | 园豆:306
提问于:2011-12-30 17:27
< >
分享
所有回答(1)
0
artwl | 园豆:16736 (专家六级) | 2011-12-30 22:16

function  pseth() { 
    var iObj = parent.parent.document.getElementById('frame_content');
    iObjH = parent.parent.frames["frame_content"].frames["iframeC"].location.hash;
    iObj.style.height = iObjH.split("#")[1]+"px";
}

parent.parent这句话我在firefox试过。。不对哦。。返回是值agent.html,,,期望值应该main.html才对

郁闷。。

支持(0) 反对(0) walleyekneel | 园豆:306 (菜鸟二级) | 2011-12-30 22:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册