再问:iframe 调用远程文件界面自适应高度 主页<td id=iHeight>框架页<body onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 子页面加上<body onload="window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+10);">这句话,有的时候可以显示,怎么有的时候是提示“拒绝访问”,有没有更好的法子,(子页面、主页面我都可以修改) to FEB15(83年的矿泉水) :提示拒绝访问。不过还是谢谢你 onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;" 哦不是你的onload="window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+10);"父页插入iframe的表格的<td id=iHeight> to FEB15(83年的矿泉水) 你的是远程调用吗?我的父页面:<table width=500 border=1><tr><td id=iHeight><iframe width="100%" scrolling="NO" frameborder=0 name=ifs id=ifs src="http://远程地址/iframe1.html"></iframe></td></tr></table>子页面:<body onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;"><table width="294" border="0" cellspacing="0" cellpadding="0">可是不行啊! iframe 里面 加入 height=100% 看看。 不是iframe的问题,是子页面没有操作父页面的权利。行:14字符:1错误:拒绝访问。代码:0URL: http://远程地址/iframe1.html <script language=javascript> function iframeAutoFit() { if(self!=top && window.name=="mainFrame") { var iframe = parent.document.getElementById(window.name); if(iframe) { iframe.parentNode.style.height = iframe.style.height; iframe.style.height = 10; var h = document.body.scrollHeight; var minimalHeight = 423; h = h<minimalHeight ? minimalHeight : h; if(window.navigator.appName == "Microsoft Internet Explorer" && iframe.frameBorder=="1") h += 4; iframe.parentNode.style.height = iframe.style.height = h; } else alert("Iframe's id unequal to iframe's name!"); } } if(document.attachEvent) { window.attachEvent("onload", iframeAutoFit); } else window.addEventListener('load', iframeAutoFit, false); </script> 一个滑动门效果在vs2010里报错 急!!!jquery ui dialog 返回值问题 帮忙看看写错了吗? 求一个位置的函数... 在新标准多浏览器兼容的情况下,如何用js取出浏览器中除去地址栏工具栏等的空白区域高度 哪位高手帮我解密一下这代码 这个应该是javascript做的吧 一个菜单背景图片显示的问题??? 请问大牛们,onbeforeunload在firefox下的如何判断刷新和关闭事件 如何去除字符串的首尾“▓”号 求救:如何在表格中鼠标放上时更改表格的背景图?在线等! 关于HTC的问题
这句话,有的时候可以显示,怎么有的时候是提示“拒绝访问”,有没有更好的法子,(子页面、主页面我都可以修改)
不是你的
onload="window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+10);"父页插入iframe的表格的<td id=iHeight>
你的是远程调用吗?
我的父页面:
<table width=500 border=1>
<tr><td id=iHeight><iframe width="100%" scrolling="NO" frameborder=0 name=ifs id=ifs src="http://远程地址/iframe1.html">
</iframe></td></tr></table>子页面:
<body onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;">
<table width="294" border="0" cellspacing="0" cellpadding="0">可是不行啊!
行:14
字符:1
错误:拒绝访问。
代码:0
URL: http://远程地址/iframe1.html
function iframeAutoFit()
{
if(self!=top && window.name=="mainFrame")
{
var iframe = parent.document.getElementById(window.name);
if(iframe)
{
iframe.parentNode.style.height = iframe.style.height;
iframe.style.height = 10;
var h = document.body.scrollHeight;
var minimalHeight = 423;
h = h<minimalHeight ? minimalHeight : h;
if(window.navigator.appName == "Microsoft Internet Explorer"
&& iframe.frameBorder=="1") h += 4;
iframe.parentNode.style.height = iframe.style.height = h;
}
else alert("Iframe's id unequal to iframe's name!");
}
}
if(document.attachEvent)
{
window.attachEvent("onload", iframeAutoFit);
}
else window.addEventListener('load', iframeAutoFit, false);
</script>