作者PICASSO1 (Pablo Picasso G.)
看板Ajax
标题[问题] 用超连结一次更新两个FRAME??
时间Wed Oct 20 09:11:31 2010
各位JavaScript的先进,大家好!!小弟有一个问题想要请教一下:
就是我想要用一个超连结 (Hyper Link)点选一次之後,一次更新同一个视窗的两个Frame
程式码如下,总共有五档案,每个档案之间以分隔线区别,以利阅读。档名跟Frame Name
也取得浅显易懂。
我的想法是想要点选Left.HTML里面的超连结,然後可以更新到Upper.HTML和Lower.HTML
这
两个FRAME。
我有用过top.UPPER.location.href,不过这似乎无效....请教各为该怎麽做比较好??
谢谢!!程式码如下:
<!-- Main.HTML -->
<html>
<head>
<title>分割视窗复习!!</title>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<frameset cols="*,*">
<frame src="./Left.HTML" scrolling="AUTO" name="LEFT" noresize marginwidth=
10 marginheight=20></frame>
<frame src="./Right.HTML" name="RIGHT"></frame>
</frameset>
<noframe>请用有支援Frame (框架)的浏灠器!! </noframe>
<body>
</body>
</html>
//============================================================================
<!-- Left.HTML -->
<html>
<head>
<title>This left window!!</title>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<script language="JavaScript">
</script>
</head>
<body>
<center>
<a href="javascript: " onclick="parent.UPPER.location.href='
http://www.goo
gle.com.tw/'; parent.LOWER.location.href='
http://www.gamer.com.tw/'; r
eturn false">按下这个超连结,会同时更新右边两个视窗框架!!</a>
</center>
</body>
</html>
//============================================================================
<!-- Right.HTML -->
<html>
<head>
<title>这是右边的分割视窗!!</title>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<frameset rows="*,*">
<frame src="./Upper.HTML" scrolling="YES" name="UPPER" noresize marginwidth=
30 marginheight=40></frame>
<frame src="./Lower.HTML" scrolling="NO" name="LOWER" noresize marginwidth=
50 marginheight=60></frame>
</frameset>
<noframe>请用有支援Frame (框架)的浏灠器!! </noframe>
<body>
<center>Hello!! World!!</center>
</body>
</html>
//============================================================================
<!-- Upper.HTML -->
<html>
<head>
<title>This upper window!!</title>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<center>This <b>UPPER</b> window!!</center>
</body>
</html>
//============================================================================
<!-- Lower.HTML -->
<html>
<head>
<title>This lower window!!</title>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<center>This <b>LOWER</b> window!!</center>
</body>
</html>
--
"◢██◣ 呼呼呼~ 为什麽…我这麽爱你…
↙操B跑车 " ,█◥◥◥ ˊ 对不起,因为他有车。ˋ◢██◣
▄◣ ◤ ◎ ◎ ◣◢██◣ˊ █◥◥◥▌
◣◥◣ ◥ ▼◤ ▉█◥◥◥ ◤ ▇ ▇◤
██████ ◣ ╲██◣ ▉◤ ▄ ▄ ◥ █▲◤
██◤▄◥█▃ ◢ █▃●╲ ◤╲█"█◤ g121630作 ◢ ◣ ◣
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.229.128.76