Redirection with js

0 votes
484 views
added Mar 23, 2018 in Javascript by LC Marshal Captain (25,790 points)
edited Jul 13, 2018 by LC Marshal
<html>
    <body>
    <p>You will be redirected in 5 seconds</p>
    <script>
        var timer = setTimeout(function() {
            window.location='http://hormart.com'
        }, 5000);
    </script>
</body>
</html>

1 Response

0 votes
responded Mar 3, 2022 by lcjr First Warrant Officer (11,830 points)
// target blank redirection
window.open('http://www.example.com', '_blank');

// parent redirection
window.location.href = "http://www.example.com";

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...