开发者

Javascript select boxes based on previous selection

开发者 https://www.devze.com 2022-12-24 10:40 出处:网络
How can I ensure that this d开发者_如何学Gooes NOT open in a new window?? onclick=\"ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)\"/>

How can I ensure that this d开发者_如何学Gooes NOT open in a new window??

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


if you want it open in a same window you need to write

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


You should replace it with:

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

Window.open() opens a new window; document.location changes the page in the current window.


Do you want it to open in the same window?

if so use window.location

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号