• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

how can I create a temporizer in Javascript to redirect my page to another?

Hello Guys

I have a page and it must be open for 5 minutes and after this, it need to load another page or close it. How can I do this in javascript ou jquery?

thanks
Alex
0
hidrau
Asked:
hidrau
  • 4
  • 3
1 Solution
 
leakim971PluritechnicianCommented:
put the following in head section :
<script>
setTimeout("location.href='http://www.domain.com/path/to/newpage.html'", 5 * 60 * 1000);
</script>

Open in new window

0
 
hidrauAuthor Commented:
Hi, this settimeout, can I determine the time?
0
 
leakim971PluritechnicianCommented:
5 * 60 * 1000 = 5 minutes

setTimeout( what2run, delay_in_Milliseconds )
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
hidrauAuthor Commented:
Hi leakim971

is It possible to close the window unless to load another page?

0
 
leakim971PluritechnicianCommented:
no page no javascript, you can't say : run this in five minutes but for now close.
0
 
hidrauAuthor Commented:
thanks very much
0
 
leakim971PluritechnicianCommented:
You're welcome! Thanks for the points!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now