How to redirect from one URL to another URL?

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

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

7条回答
  •  囚心锁ツ
    2020-12-05 03:21

    Since you tagged the question with javascript and html...

    For a purely HTML solution, you can use a meta tag in the header to "refresh" the page, specifying a different URL:

    
    

    If you can/want to use JavaScript, you can set the location.href of the window:

    
    

提交回复
热议问题