[請益] 關於下拉式選單改變iframe頁面的問題

看板Ajax作者 (逆天天)時間15年前 (2010/12/01 23:03), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
※ [本文轉錄自 PHP 看板 #1CzYkqjG ] 作者: j1031865 (逆天天) 看板: PHP 標題: [請益] 關於下拉式選單改變iframe頁面的問題 時間: Wed Dec 1 19:04:18 2010 請問一下 假設我現在網頁用frame分成上下層,上面的命名為top,下面的命名為right 若我現在下面的網頁中有一個下拉式選單、一個button送出下拉式選單所選擇的東西 和一個iframe,iframe命名為out 而我想要在選擇下拉式選單,按下button後,可以改變iframe的頁面, 目前我只能改變right‧請問option value要改成什麼才可以改變iframe? 以下是程式碼 <script> <!-- function land(ref, target) { if (target=="_self") {window.location=loc;} else {if (target=="_top") {top.location=loc;} else {if (target=="_blank") {window.open(loc);} else {if (target=="_parent") {parent.location=loc;} else {parent.frames[target].location=loc;}; }}} } function jump(menu) { ref=menu.choice.options[menu.choice.selectedIndex].value; splitc=ref.lastIndexOf("&"); target=""; if (splitc!=-1) {loc=ref.substring(0,splitc); target=ref.substring(splitc+1,1000).toLowerCase();} else {loc=ref; target="_self";}; if (ref != "") {land(loc,target);} } --> </script> <form> <center> <p>&nbsp;</p> <p> <select name="choice" style="height:30px;width:150px;"> <option value="">請選擇顧客群組</option> <option value="class.php?class=0&amp;right">無群組</option> <option value="class.php?class=1&amp;right">群組一</option> <option value="▃ass.php?class=2&amp;right">群組二</option> <option value="class.php?class=3&amp;right">群組三</option> <option value="class.php?class=4&amp;right">群組四</option> </select>&nbsp; <input type="button" value="查詢顧客群組資料" onClick="jump(this.form)" style="height:30px;width:150px;"> </p> </center> </form> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.64.178.29 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.64.178.25 ※ 編輯: j1031865 來自: 203.64.178.25 (12/01 23:10)
文章代碼(AID): #1CzcEpzB (Ajax)
文章代碼(AID): #1CzcEpzB (Ajax)