views:

63

answers:

1

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?

+2  A: 

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);
Kobi
I will try that
MrEnder
perfect thanks ^.^
MrEnder
works wonderfully on my site try it out ^.^ http://localhost/INTN2201/lab/index.phpuse that site with JS enabled then disable it and refresh then enable it again and refresh ^.^
MrEnder
I appreciate the offer, but obviously I cannot access a site on your localhost :) Thanks!
Kobi
oops >< let me grab the right link >< jeez half asleep sorry
MrEnder
http://opentech.durhamcollege.ca/~intn2201/brittains/labs/there we go correct link
MrEnder