作者j1031865 (逆天天)
看板Ajax
标题[请益] 关於下拉式选单改变iframe页面的问题
时间Wed Dec 1 23:03:13 2010
※ [本文转录自 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)