javascript redirect to url

Solutions on MaxInterview for javascript redirect to url by the best coders in the world

showing results for - "javascript redirect to url"
Julián
13 Feb 2019
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";
Nail
14 Jan 2019
1<script>
2  window.location.href = "http://mywebsite.com/home.html";
3</script>
Ethan
16 Mar 2016
1window.location.href = "http://mywebsite.com/home.html";
María Alejandra
11 Jan 2018
1window.location.replace('http://mywebsite.com/home.html');
Lorenzo
31 Apr 2019
1<p onclick="myFunction()"></p>
2<script>
3function myFunction() {
4	  window.location.href = "https://whereyouwouldliketogo.com"
5}
6</script>
similar questions
queries leading to this page
javascript redirect to url