你如何在JavaScript中转到网址? [英] How do you goto a url in JavaScript?

查看:70
本文介绍了你如何在JavaScript中转到网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在JavaScript中转到网址?



< script type =   text / javascript> 
function gotoindex(){
?( http://www.mysite.com/index.htm
}
< / script>

解决方案

使用位置分配()方法 [ ^ ]


就这样做



location.assign(http://www.w3schools.com);

How do you goto a url in JavaScript?

    <script type="text/javascript">
    function gotoindex() {
        ?("http://www.mysite.com/index.htm")
            }
</script>

解决方案

Use Location assign() Method[^]


Just do like this

location.assign("http://www.w3schools.com");


这篇关于你如何在JavaScript中转到网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆