首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

用document.frames['myframe'].location.reload(true)刷新iframe时提示"权限不够",怎么解决

2012-02-24 
用document.frames[myframe].location.reload(true)刷新iframe时提示"权限不够",如何解决?代码如下,当if

用document.frames['myframe'].location.reload(true)刷新iframe时提示"权限不够",如何解决?
代码如下,当iframe引用的是别的站点的页面时,就会提示权限不够,同一个站点时就没问题,请问该如何解决?
<body   onload= "javascript:document.frames[ 'myframe '].location.reload(true) ">
<iframe   id= "myframe "   src= "http://www.mytest.com/top.html "> </iframe>
</body>

[解决办法]
跨域的问题,没得解.
[解决办法]
换个方案:
try:document.all.myframe.src= document.all.myframe.src
[解决办法]
<body onload= "javascript:window.document.frames[ 'myframe '].location=window.document.frames[ 'myframe '].location ">
<iframe id= "myframe " src= "http://www.mytest.com/top.html "> </iframe>
</body>
[解决办法]
<body onload= "javascript:window.document.frames[ 'myframe '].location.href=window.document.frames[ 'myframe '].location.href; ">
<iframe id= "myframe " src= "http://www.mytest.com/top.html "> </iframe>
</body>
[解决办法]
跨域的话不能访问iframe内页的对象,会提示权限不足
[解决办法]
document.frames[ 'myframe '].location

location不是iframe标签内的属性,是内部的对象

在iframe里面提交iframe的地址到parent的var中,用iframe.src=var
这样应该差不多吧

[解决办法]
Tianminghui(colin)说的没错! location 也是内部的对象!跨域的情况下是无权访问的!但是,FEB15(张郎)的方法也可以起到刷新的效果的~~

热点排行