基于先前选择的Javascript选择框

基于先前选择的Javascript选择框,javascript,select,onclick,Javascript,Select,Onclick,如何确保此窗口不会在新窗口中打开 onclick="ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)"/> 要在同一窗口中打开吗 如果是这样,请使用窗口位置将其替换为: onclick="ob=this.form.table;document.location=ob.options[ob.selectedIndex].value;"/> open()打开一个新窗口;document.locatio

如何确保此窗口不会在新窗口中打开

onclick="ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)"/>

要在同一窗口中打开吗


如果是这样,请使用
窗口位置

将其替换为:

onclick="ob=this.form.table;document.location=ob.options[ob.selectedIndex].value;"/>

open()打开一个新窗口;document.location更改当前窗口中的页面。

如果要在同一窗口中打开页面,则需要编写

onclick="ob=this.form.table;window.location.href=(ob.options[ob.selectedIndex].value)"/>