Home > Blockchain >  Redirection code is not working on webnode
Redirection code is not working on webnode

Time:10-06

I have added this code to my webnode html but it's not working. Can anyone have the solution.

<script>
        var timer = setTimeout(function() {
            window.location='https://google.com'
        }, 3000);
    </script>

CodePudding user response:

I reformatted this and it seems to work. What are you running it on? and what browser. I used MS Edge on Windows 10 Pro to test it and just added the HTML tag

<html>

<script>
    var timer = setTimeout(function () {
        window.location = 'https://google.com'
    }, 3000);
</script>

</html>

CodePudding user response:

there is nothing wrong in your code just sometimes there is a cache data in your browser restart your browser and try to run your code again or use different browser. i test your code and its work on my browser

  •  Tags:  
  • html
  • Related