调用多层父页面对象. 利用parent.parent 来一级一级向上引用父层的内容 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 window.top.document.getElementById("obj")...... 这个用不上啊,要调用最顶层的javascript里面的对象. 例如Array对象。 ??var arr=new Array();主页面window.top.arr[..]不就可以拿到了吗? if( window.top != null) { userInfo = window.top.userInfo; } 取不到. 这个是我做的试验是可以取到值的a主页面<html ><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title></title><script>var ab= new Array(10);ab[0]=0;ab[1]=1;</script></head><body><iframe id="a" src="b.html" style="width:200; height:200"></iframe></body></html>b是a的子页面<html> <head> <title> New Document </title> </head> <body> <iframe id="b" src="c.html" style="width:200; height:200"></iframe> </body></html>c是b的子页面<html ><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>c</title><script>function test(){ if(window.top!=null) { var s=window.top.ab; alert(s) }}</script></head><body><input type="button" onclick="test()" /></body></html> thanks 最近刚从C/S转B/S开发.被这javascript搞的真够郁闷的。 如何用DOM加入新的 ul? 如何多次调用script里面的代码 遍历文件 支持火狐 救命啊.都一天了.还是没出来 Select控件中如何正确的获取选中的option呢? 谁有用javascript写的line()函数(也就是画线的程序) 大家帮忙看一下 调用js的这个函数为什么不出来 怎样从easyui-window关闭时,传递一个信息给父页面? 不做任何动作,怎么自动判断输入的内容, 请问? 谢了!!!. 如何写成正则表达式? 怎样在非IE浏览器中使用CSS滤镜?
var arr=new Array();主页面
window.top.arr[..]不就可以拿到了吗?
{
userInfo = window.top.userInfo;
} 取不到.
a主页面
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script>
var ab= new Array(10);
ab[0]=0;
ab[1]=1;
</script>
</head><body>
<iframe id="a" src="b.html" style="width:200; height:200"></iframe>
</body>
</html>b是a的子页面<html>
<head>
<title> New Document </title> </head> <body> <iframe id="b" src="c.html" style="width:200; height:200"></iframe>
</body>
</html>
c是b的子页面
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>c</title>
<script>
function test()
{
if(window.top!=null)
{
var s=window.top.ab;
alert(s)
}
}
</script>
</head><body>
<input type="button" onclick="test()" />
</body>
</html>