I have created a quiz in javascript and I am using HTML forms to present it. I have verifed all of the users answers with if statements and if they get it either right or wrong a prompt box pops up to ask if they want to try again. When they say yes the quiz starts again but when they say no nothing happens and I would like it to automatically redirect itself to my homepage. Does anyone know how to do that? My website is not on a server it needs to be able to run off a CD or a USB.
Asked
Active
Viewed 43 times
-3
-
1http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript – Zhihao Mar 12 '14 at 16:58
-
`window.location.href = "http://yourhomepage.com";` – Adween Mar 12 '14 at 16:58
3 Answers
1
Use window.location
. here's an example:
window.location.replace("yourpage.htm");

Tiago César Oliveira
- 812
- 8
- 18
0
Use the window.location object:
window.location.assign("http://www.w3schools.com");

drdwilcox
- 3,833
- 17
- 19
0
use window.location
There are many ways. my favourite is
window.location.href = "http://yourhomepage.com";

Adween
- 2,792
- 2
- 18
- 20