刷新页面究极问题~大神进 a页面中有一个iframe指向b,在b中用window.open弹出页面c, 在c中刷新a页面(opener.parent),此时c已经失去了opener的引用,也就是说再通过opener是找不到b页面的,那么如果还想刷新a页面怎么做????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试下在首次刷新A时用全局变量存opener.parent然后在C中再次刷新A。 a 刷新后,c的opener已经不存在了,想在c中,再刷新a是不可能的,因为新的a和c之间是没有关系的。 c调b的方法,b调a的方法就行了a.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body bgcolor=red> this is a <iframe name=tt id=tt src="b.html" width=100%></iframe> </body></html><script language="JavaScript"> window.onload=function() { alert("刷新了"); } function aa(){ window.location=window.location; } </script>b.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body bgcolor=green> <input type=button value="open c.html" onclick="window.open('c.html')"> </body></html><script language="JavaScript"> function bb() { parent.aa(); } </script>c.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body bgcolor="yellow"> <input type="button" value="refresh a.html" onclick="cc()"> </body></html><script language="JavaScript"> function cc() { window.opener.bb(); } </script> chen_xiangguo 你能不能先试试再贴出来,不要什么事情都想当然。 CSDN果然无牛人。 问题已经解决了,但我不说 js怎么给网页设置背景音乐 输出标签 转义问题 jquery怎么移除不了事件呢? 谈谈你对函数式编程的理解和看法。 如何实现 input中日期"-"符号不能修改 只能修改其中的数字???? 请问QQ空间的漂浮代码怎么做,点击链接之后再飘,而不是载入页面漂 js中怎么能令下条语句延时5秒钟执行??急!!!!!!!!!!! 求本地免激活javascript解决方案 打开网页的简单问题。 js 的学习路线和书籍推荐 var a = new A();和var a = {};A.call(a);一样吗? this._io = open || false是什么意思
然后在C中再次刷新A。
a.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body bgcolor=red>
this is a
<iframe name=tt id=tt src="b.html" width=100%></iframe>
</body>
</html>
<script language="JavaScript">
window.onload=function()
{
alert("刷新了");
}
function aa(){
window.location=window.location;
}
</script>
b.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body bgcolor=green>
<input type=button value="open c.html" onclick="window.open('c.html')">
</body>
</html>
<script language="JavaScript">
function bb()
{
parent.aa();
} </script>
c.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body bgcolor="yellow">
<input type="button" value="refresh a.html" onclick="cc()">
</body>
</html><script language="JavaScript">
function cc()
{
window.opener.bb();
} </script>