graham23s Posted March 4, 2008 Share Posted March 4, 2008 Hi Guys, i use this piece of code to refresh to another page: // javascript refresh // print('<script type="text/javascript">window.location = "account.php"</script>'); is there a way i can delay it by like 10 seconds or so to display a message before it refreshed? thanks guys Graham Quote Link to comment Share on other sites More sharing options...
fenway Posted March 4, 2008 Share Posted March 4, 2008 setTimeout? Quote Link to comment Share on other sites More sharing options...
graham23s Posted March 4, 2008 Author Share Posted March 4, 2008 Hi Mate, that sounds good i tried: print('<script type="text/javascript">setTimeout("window.location="account.php", 500")</script>'); but this doesn't work is it a syntax problem at all? cheers Graham Quote Link to comment Share on other sites More sharing options...
fenway Posted March 5, 2008 Share Posted March 5, 2008 Yes, it's a quoting issue... escape your nested double quotes. Quote Link to comment Share on other sites More sharing options...
graham23s Posted March 5, 2008 Author Share Posted March 5, 2008 Hi Mate, i did: print('<script type="text/javascript">setTimeout("window.location=\"account.php\", 500")</script>'); but from what i can see it doesn't wait 5 seconds before refreshing it still does it pretty much straight away i thought 500 millisecs was 5 seconds am i wrong? thanks mate Graham Quote Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2008 Share Posted March 5, 2008 An ms is a thousandth of a second. You can think of it as mille = french word for thousand. As a millimeter is a thousandth of a meter. 5000 ms is 5 seconds. Set it to 5000. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 6, 2008 Share Posted March 6, 2008 Or you can think of it as latin, since it is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.