javascript 框架间函数传递

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>

你可能感兴趣的:(JavaScript,html,框架,function,input,border)