Question

I tried to do

<script type="text/javascript"> //<![CDATA[ document.write('<meta http-equiv="refresh" content="0;url=index.php" />'); //]]> </script>

but that doesn't validate on strict =[

how can I do that with JS alone?

Was it helpful?

Solution

How about:

location.href = 'index.php';

To refresh the same page:

location.reload();

To wait 2 seconds before reloading (as <meta> can do):

setTimeout(function(){ location.reload(); }, 2000);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top