87,922
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<frameset rows="116,*" cols="*" framespacing="0" frameborder="NO" border="1">
<frame src="ajax007_01.htm" name="topFrame" scrolling="NO" noresize>
<frame src="ajax007_02.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Ajax007_01.htm</title>
<style type="text/css">
body{font-size:12px; font-family:arial; color:#333333; font-weight:bold;background-color: #004080;}
td{font-size:12px; font-family:arial; color:#333333; font-weight:bold}
</style>
</head>
<script type="text/javascript" language="javascript">
function showx(){
alert("This function is defined in top Frame: topFrame window...");
}
</script>
<body>
<p><font color="#FFFFFF">TOP Frame window</font></p>
<font color="#FFFFFF">
Frame name: topFrame<br>
Frame src: Ajax007_01.htm
</font>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Ajax007_02.htm</title>
</head>
<style type="text/css">
body{font-size:12px; font-family:arial; color:#333333; font-weight:bold;}
td{font-size:12px; font-family:arial; color:#333333; font-weight:bold}
</style>
<body>
<p>Main Frame window</p>
<p>引用上一个Frame的函数</p>
<br>
<input id="btn01" name="btn01" value="click" type="button" onClick="javascript:parent.topFrame.showx();">
<p>调用: onClick="javascript:parent.topFrame.showx();"</p>
<p> </p>
Frame name: mainFrame<br>
Frame src: Ajax007_02.htm
</body>
</html>
<frameset>
<frame src="aa.html" id="aa"/>
<frame src="bb.html" id="bb"/>
</frameset>
<frameset id="mainframe">
<frame src="aa.html" name="aa"/>
<frame src="bb.html" name="bb"/>
</frameset>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<frameset id="frames" name="frames" rows="30%,69%" cols="*" framespacing="2" frameborder="2" border="2">
<frame src="ajax007_01.htm" name="topFrame" scrolling="NO" noresize>
<frame src="ajax007_02.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Ajax007_01.htm</title>
<style type="text/css">
body{font-size:12px; font-family:arial; color:#333333; font-weight:bold;background-color: #004080;}
td{font-size:12px; font-family:arial; color:#333333; font-weight:bold}
</style>
</head>
<script type="text/javascript" language="javascript">
function $(id){
return 'string'==typeof(id) ? document.getElementById(id) : id;
}
function showHide(id,showFlag){
var f=showFlag.toLowerCase();
var o=$(id);
if(f=='hide')
o.style.display='none';
else
o.style.display='block';
}
</script>
<body>
<div id="div01">
<p><font color="#FFFFFF">TOP Frame window</font></p>
<font color="#FFFFFF">
Frame name: topFrame<br>
Frame src: Ajax007_01.htm
</font>
</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Ajax007_02.htm</title>
</head>
<style type="text/css">
body{font-size:12px; font-family:arial; color:#333333; font-weight:bold;}
td{font-size:12px; font-family:arial; color:#333333; font-weight:bold}
</style>
<script type="text/javascript" language="javascript">
function $(id){
return 'string'==typeof(id) ? document.getElementById(id) : id;
}
function changeWin(){
var h=0;
try{
h=parseInt($('wh').value)
}catch(e){
h=20;
}
if(h>=100) h=90; //must be save some space for B page
parent.document.getElementById('frames').rows=''+h+'%,*'; //change the heiht of top frame
}
</script>
<body>
<p>Main Frame window</p>
<p>引用上一个Frame的函数</p>
<br>
<input id="btn01" name="btn01" value="隐藏上窗口内容" type="button" onClick="javascript:parent.topFrame.showHide('div01','hide');">
<input id="btn01" name="btn01" value="显示上窗口内容" type="button" onClick="javascript:parent.topFrame.showHide('div01','show');">
输入窗口高度大小值:<input id="wh" name="wh" value="20" type="text">%
<input id="btn01" name="btn01" value="窗口大小更改" type="button" onClick="javascript:changeWin();">
<p>调用: onClick="javascript:parent.topFrame.showx();"</p>
<p> </p>
Frame name: mainFrame<br>
Frame src: Ajax007_02.htm
</body>
</html>