Adding the following script to the page will immediately redirect visitors to the specified URL.
<Script type = "text/javascript"> window. location. href = "http://www.example.com/"; </script>
Location. href and location. the difference between replace and replace is location. href creates a history record in the visitor's browser. this means that when a visitor clicks the back button, it will be forcibly redirected back to the specified url to form a loop. using the following code, you can jump back to the original page to avoid damages to the browser rollback path.
<Script type = "text/javascript"> location. replace ('HTTP: // www.example.com/'); </script>
The following is an example of conditional jump. You can modify it to meet your needs.
<Script language = "JavaScript" type = "text/javascript"> if (screen. width >=1024) & (screen. height >=768) {registry.location.replace('example.html ') ;}</script>
References
============================
Javascript Redirect Scripts
Http://andylangton.co.uk/articles/javascript/javascript-redirect-scripts/