[問題] 用超連結一次更新兩個FRAME??

看板Ajax作者 (Pablo Picasso G.)時間15年前 (2010/10/20 09:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
各位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
文章代碼(AID): #1Cla79ud (Ajax)
文章代碼(AID): #1Cla79ud (Ajax)