JDP 發表於 2010-5-3 14:08:59

MM_jumpMenu 開新視窗的方法

將 eval(targ+".location='"+selObj.options.value+"'");
改為var s = selObj.options.value;
window.open(s);完整範例如下:<SCRIPT language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
var s = selObj.options.value;
window.open(s);
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>

Then function called from form:

<FORM name="form1">
<SELECT name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<OPTION selected>-- select --</OPTION>
<OPTION value="http://google.com">Google</OPTION>
</SELECT>
</FORM>
Reference: http://www.webdeveloper.com/forum/showthread.php?t=2709
頁: [1]
查看完整版本: MM_jumpMenu 開新視窗的方法