recherche

Maison  >  Questions et réponses  >  le corps du texte

javascript - html页面跳转时,如何不受根目录的影响?

使用window.location="www.baidu.com"总会在前面加上本地的url,这样http://localhost:3000/www.bai...。要怎么样可以直接访问www.baidu.com,而不加上前缀那?

天蓬老师天蓬老师2855 Il y a quelques jours670

répondre à tous(2)je répondrai

  • PHPz

    PHPz2017-04-11 09:19:50

    网址前面加上http://

    répondre
    0
  • 天蓬老师

    天蓬老师2017-04-11 09:19:50

    window.location="//www.baidu.com"
    
    window.location="http://www.baidu.com"
    

    都行

    répondre
    0
  • Annulerrépondre