这个问题,之前我有帮人解决过...如果,你是用的框架FRAME的话,你可以把那个异域的网页包含在一个框架下面,而这个异域地址的页面是属于window.top或是window.parent的,而window.top或window.parent是归我管的,想怎么刷就怎么刷...如果是用window.open来打开的新窗口,也可以用一个框架把它包含起来...懂不???呵呵....
调试欢乐多
我是包含在框架里的,框架里两个frame,一个是我自己的html,一个是异域html
我用
window.parent.frame[1].location.reload()就权限错误
<head>
</head>
<body topmargin="0" leftmargin="0">
<iframe src="http://www.sina.com.cn" name="sina" id="sina" width="100%" height="100%"></iframe>
<script>
//现在,想要刷这个IFRAME的话,可以
window.location.reload();
</script>
</body>
</html>
所以应该是
var mainframe=window.parent.frame[1];
mainframe.frame[1].location.reload();
这就是我的代码,IE提示,没有权限
HTA的权限很高,你可以爱咋咋地...
//
<input onkeypress="if(event.keyCode == 13)createwin(800,500,this.value)" id=urlinput value="http://" style="width:100%;" title="id=urlinput;请在此输入网页地址;窗口ID=win">
<textarea style="width:100%;height:100%" id=command title="id=command 弹出窗口ID=win 全局JS窗口:jsweb;在此输入命令后按右键运行" oncontextmenu='eval(this.value)'>jsweb.document.open();
jsweb.document.write(
'<script' + '>\n'
+'var topwin = null;\n'
+'</script' + '>\n'
);
jsweb.topwin = window;
jsweb.document.write(js.value);
jsweb.document.close();
</textarea>
<textarea id=js style="width:100%;height:100%;" title="id=js">
<script>
function unload(){
try{
if(topwin.win.document.body.readyState == "complete"){
if(topwin.win.status == "qidizi")return false;
var wa = topwin.win.document.all;
for(var i = 0; i < wa.length;i++){
wa[i].style.display = "";
wa[i].style.color = "black";
}
topwin.win.status = "qidizi";
}
}catch(e){;}
}
setInterval("unload()",1000);</script>///取消所有的禁止alleventnull();
//用于解除西南之窗的播放器右键的禁止(先在支付影币的窗口按CTRL+I;然后放入弹出的TEXTAREA中,右键)
this.parentElement.style.top = 50;
document.links[0].outerHTML = document.links[0].outerHTML.replace("window.open","o = window.open");
//o.frames[0].location.href = o.frames[0].msplayer.SourceLink;;</textarea>
<script language ='javascript'>
<!--
var win = null;
function createwin(w,h,u){
try{
win.location.href = u;
}catch(e){
win = window.open("",'xwin','width=' + w + ',height=' + h + ',menubar=no,toolbar=no,location=yes,directories=no,status=yes,scrollbars=yes,resizable=yes');
win.location.href = u;
}
}function alleventnull(){
win.window.onerror = null;
win.document.oncontextmenu = null;
win.document.onkeydown = null;
win.document.ondragstart= null;
win.document.onmousedown= null;
win.window.onmousedown = null
win.document.body.oncontextmenu = null;
win.document.body.onkeydown = null;
win.document.body.ondragstart= null;
win.document.body.onmousedown= null;
}function forx(n)
{
if(n == null) return false;
js.value = "";
for (var v in eval(n))
{
js.value += n + '.' + v + ' = ' + eval( n + '.' + v) + '\n';
}
}
//-->
</script>
<iframe src="http://www.sina.com.cn" name="sina" id="sina" width="100%" height="100%"></iframe>