[請益] 關於下拉式選單改變iframe頁面的問題
※ [本文轉錄自 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> </p>
<p>
<select name="choice" style="height:30px;width:150px;">
<option value="">請選擇顧客群組</option>
<option value="class.php?class=0&right">無群組</option>
<option value="class.php?class=1&right">群組一</option>
<option value="▃ass.php?class=2&right">群組二</option>
<option value="class.php?class=3&right">群組三</option>
<option value="class.php?class=4&right">群組四</option>
</select>
<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)
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章