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
LVL 1
hidrauAsked:
Who is Participating?
 
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.