Jump to content

Timer before refresh


graham23s

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.