[問題] 用超連結一次更新兩個FRAME??
各位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
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章