How to redirect from one URL to another URL?

前端 未结 7 686
忘了有多久
忘了有多久 2020-12-05 02:22

How can I redirect to another URL in a web page using JavaScript?

7条回答
  •  难免孤独
    2020-12-05 03:15

    If you want to redirect, just use window.location. Like so:

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

提交回复
热议问题