javascript重定向到新窗口 [英] javascript redirect to new window
本文介绍了javascript重定向到新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个代码根据下拉列表的值重定向到页面:
I have this code that redirects to a page based on the value of a dropdown list:
<Script language="JavaScript">
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</SCRIPT>
如何在新窗口中打开它?
How do I make that open in a new window?
推荐答案
function goto(form) {
var index = form.select.selectedIndex
if (form.select.options[index].value != "0") {
location = form.select.options[index].value;
window.open(location);
}
}
有关<$可用选项的完整列表c $ c> window.open ,请参阅 https:// developer .mozilla.org / en / DOM / window.open
这篇关于javascript重定向到新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文