dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Intermediate
Feb 21, 2002

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Use JavaScript to Add a Timed Automatic Refreshing Function to a Page


Using the JavaScript program, you can let the user view a Web page only for certain time. After that specific period, without the user interaction the page will dispel another a page.
 
<lhtml>
<script language="JavaScript">
counter = 0;
id=setTimeout("goToNextPage();",1000);
function goToNextPage()
{
	counter++;
	if(counter >= 10)
	{
		alert ("Your Time is Over");
		document.fname.submit();
	}
	else
	{
		window.status="Remaining Seconds  " + counter;
	}
id=setTimeout("goToNextPage();",1000);
}
</script>
<body>
<form name="fname" method="post" action = "next.htm">
</form>
<font color="green">><h1>This page can viewed only _
for 10 Seconds. Hurry
Up</h1></font>
</body>
</html>

This code for next.htm page

<html>
<body>
<font color="red"><h1>Ur time is Over!!!!!!!!!</h1></font>
</body>
<html>
Kumaravel
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date