专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Javascript教程 » javascript变量:多个页面共享JAVASCRIPT 变量和对象 »正文

javascript变量:多个页面共享JAVASCRIPT 变量和对象

来源: 发布时间:星期四, 2009年2月12日 浏览:325次 评论:0


多个页面共享JAVASCRIPT 变量和对象例子代码如下大家可以直接拿代码测试

index.html

<html>
<head>
<title> New Document </title>
</head>
<frame cols="20%,80%">
<frame src="left.html" name="left" />
<frame src="right.html" name="right" />
</frame>
</html>


right.html

<html>
<head>
<title> New Document </title>
</head>
<script language="javascript">

function hello{
//self.parent.left.changeindex(10)
alert(self.parent.left.selectedindex);
}
</script>
<body _disibledevent=>
</body>

</html>


left.html


<html>
<head>
<title> New Document </title>

<script language="javascript">
var selectedindex=30;

</script>
</head>

</html>

运行index.html在右边可以得到左边selectedindex对象
0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: