showing results for - "js redirect to url"
Emie
05 Oct 2017
1// similar behavior as an HTTP redirect
2window.location.replace("http://stackoverflow.com");
3
4// similar behavior as clicking on a link
5window.location.href = "http://stackoverflow.com";
Liana
22 Apr 2017
1<script>
2  window.location.href = "http://mywebsite.com/home.html";
3</script>
Santino
27 Jan 2018
1window.location.href = "http://mywebsite.com/home.html";
Jesús
23 Sep 2018
1window.location.replace('http://mywebsite.com/home.html');
Giorgio
12 Apr 2017
1<p onclick="myFunction()"></p>
2<script>
3function myFunction() {
4	  window.location.href = "https://whereyouwouldliketogo.com"
5}
6</script>
Jonathan
26 Mar 2016
1window.location = "https://example.com/";
similar questions
queries leading to this page
js redirect to url