I have one html page "form1.html" which has an animated image. I want to load another page "form2.html" after 5 seconds. How do I do this?
Asked
Active
Viewed 1.1e+01k times
68
-
Why marked duplicate of a jQuery question while the question title is out of jQuery topics?! – Mojtaba Rezaeian Mar 16 '16 at 07:00
-
look at http://stackoverflow.com/questions/503093/how-can-i-make-a-page-redirect-using-jquery/25537534#25537534 – Patrick W. McMahon Apr 20 '16 at 20:30
-
1^ Clever way of making your third-page question look like the accepted answer, which has 8800 upvotes. – coreyward Jun 13 '16 at 18:10
4 Answers
62
<script>
setTimeout(function(){
window.location.href = 'form2.html';
}, 5000);
</script>
And for home page add only '/'
<script>
setTimeout(function(){
window.location.href = '/';
}, 5000);
</script>

Walialu
- 4,096
- 2
- 27
- 29
20
<meta http-equiv="refresh" content="5;URL='form2.html'">

Kyll
- 7,036
- 7
- 41
- 64

Majid Fouladpour
- 29,356
- 21
- 76
- 127
17
use this JavaScript code:
<script>
setTimeout(function(){
window.location.href = 'form2.html';
}, 5000);
</script>

mehdi
- 1,755
- 2
- 15
- 21
1
Use Javascript's setTimeout:
<body onload="setTimeout(function(){window.location = 'form2.html';}, 5000)">

Fleming Slone
- 181
- 16