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]