Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to load another HTML page after a specific amount of time [duplicate]

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?

like image 359
ash9209 Avatar asked Mar 30 '13 14:03

ash9209


People also ask

How do I redirect to another page after a certain time?

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after. Through this, you can automatically redirect your visitors to a new homepage.

How do I make my website show up 5 seconds to another page?

To redirect a webpage after 5 seconds, use the setInterval() method to set the time interval. Add the webpage in window.

How do I redirect a HTML page to another HTML page?

To redirect one HTML page to another page, you need to add a <meta> tag inside the <head> section of the old HTML page. The <head> section of an HTML document contains metadata that is useful for the browser, but invisible to users viewing the page.


2 Answers

<script>     setTimeout(function(){         window.location.href = 'form2.html';     }, 5000); </script> 

And for home page add only '/'

<script>     setTimeout(function(){         window.location.href = '/';     }, 5000); </script> 
like image 141
Walialu Avatar answered Oct 04 '22 01:10

Walialu


<meta http-equiv="refresh" content="5;URL='form2.html'"> 
like image 25
Majid Fouladpour Avatar answered Oct 04 '22 02:10

Majid Fouladpour