|
|
|
|
javascript 实现框架间函数的传递 |
|
www.qpsh.com
更新日期:2007-9-3 人气指数 109 |
|
|
javascript 框架间函数传递 /*********index.htm*******主文件
以下是程序代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head>
<frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="left.htm" name="leftFrame" scrolling="NO" noresize>
<frame src="right.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
/************left.htm
<html>
<body>
<input type="submit" name="Submit" value="Submit" onClick="testFunc('hello')">
<script language="javascript">
function testFunc(args){
parent.mainFrame.rightFunc(args);
}
</script>
</body>
</html>
/*********right.htm
<html>
<body>
<script language="javascript">
function rightFunc(args){
alert(args);
}
</script>
</body>
</html> |
|
|
|
【返回首页】【刷新本页】【返回顶部】【关闭本页】 |
|
|
|
|
|
|
|
|
|