子页面控制父页面打开新页面 A在浏览器地址是显示a.htmlB是由A上的方法window.open('b.html')当关闭b.html 浏览器的地址变成c.html并打开 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var i = window.open("test.html"); window.onblur = function(){ parent.location.href = "http://www.google.com.hk"; }; 如果是window.open打开的新窗口的话,也就没有parent.了吧,感觉不好使wan window.opener.location.href = 'xx.html' var i = window.open("test.html");window.onblur = function(){window.opener.location.href = "http://www.google.com.hk";}; 有一个winodw.onunload方法 不过无法判断是刷新还是关闭页面 a.html<html><script> function doSomething() { window.open("b.html"); }</script><body> <input type="button" onclick="doSomething()"/></body><html>b.html<html><script> window.onunload=function(){window.opener.location = "http://www.baidu.com";}</script><body> <input type="button" onclick="doSomething()"/></body><html>注意。这个是在IE下工作的,别的浏览器是不支持操作父窗口的 我希望点击一下下面的Menu1就调用函数go() jsp菜鸟求问各位大神在html里面用jsp动态添加文本框的问题 为何我们浏览百度之类的大网站 都没有脚本安全提示 淘宝考题 急:关于jquery显示隐藏的问题,在线等。 ATGrid报表控件/WEB插件[专业版] 这样的树形结构,不知如何下手,烦请高手出山相助,谢谢了!! 请大家来继续纠错我的js小练习题 困惑问题-------关于字符串的连接 js中显示变量未定义问题 js怎么跨框架操作控件 让图片不间断向上滚动,它会过一会停止,想让它永不停止,帮修改
window.onblur = function(){
parent.location.href = "http://www.google.com.hk";
};
也就没有parent.了吧,
感觉不好使wan
window.onblur = function(){
window.opener.location.href = "http://www.google.com.hk";
};
<script>
function doSomething()
{
window.open("b.html");
}
</script>
<body>
<input type="button" onclick="doSomething()"/>
</body>
<html>b.html
<html>
<script>
window.onunload=function(){window.opener.location = "http://www.baidu.com";}
</script>
<body>
<input type="button" onclick="doSomething()"/>
</body>
<html>注意。这个是在IE下工作的,别的浏览器是不支持操作父窗口的