htmlmetahttp-equiv

http-equiv redirect to another html page


I am trying to redirect a user on my html page to another html page automatically after three seconds, and I am trying with this code:

<meta http-equiv="refresh" content="3; home.html">

However, I get the error that it expected a "u" after ";" (url=...). I am using Atom and w3c-markup. How can I solve this?


Solution

  • Try using this. You missed url before using your redirect file

    <meta http-equiv="refresh" content="3; URL='home.html'" />
    

    You can also do it by adding some script

    <script>
            var timer = setTimeout(function() {
                window.location='home.html'
            }, 3000);
     </script>