Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript重定向到新窗口_Javascript_Redirect - Fatal编程技术网

javascript重定向到新窗口

javascript重定向到新窗口,javascript,redirect,Javascript,Redirect,我有一段代码,根据下拉列表的值重定向到页面: <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> 函数goto(form){

我有一段代码,根据下拉列表的值重定向到页面:

<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>

函数goto(form){var index=form.select.selectedIndex
if(form.select.options[index].value!=“0”){
location=form.select.options[index].value;}
//-->
如何在新窗口中打开

window.open(URL,name,specs,replace)
url:新窗口的url

名称:(可选)默认为_空白

规格:(可选)Google JavaScript window.open以获取完整列表

替换:(可选)[true | false]替换历史记录或追加

window.open(url, "nameOfTheWindow");
查看详细选项,大多数浏览器都支持这一点,但其中一些浏览器无法很好地调整弹出窗口的大小

function goto(form) {
    var index = form.select.selectedIndex
    if (form.select.options[index].value != "0") {
        location = form.select.options[index].value;
        window.open(location);
    }
}​
有关
窗口可用选项的完整列表。请打开
,请参阅


检查此函数的详细用法。

生成javascript函数:-

 onBtnPress:function(){
        window.open("http://www.yashvekaria.com", "_blank");
    }
准确的副本。您在询问之前搜索过吗?可能是
 onBtnPress:function(){
        window.open("http://www.yashvekaria.com", "_blank");
    }