C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Auto refresh a webpage at regular interval


Posted Date: 15 Oct 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Sathish       Member Level: Silver
Rating:     Points: 10



This code will reload the page every 5 seconds.


<html>
<head>
<title>Sample Page - Autorefresh</title>
<script type="text/javascript">
function setTimer()
{
setTimeout("window.location.reload()",5000);
}
</script>

</head>
<body onload="javascript:setTimer()">

</body>
</html>



To change the interval time, change the value of second param in setTimeout() function. The value will be in milliseconds.




Responses

Author: praveenjayapal    07 Nov 2008Member Level: Gold   Points : 1
Hi friend

We can even reduce the code like this .. It will work


body onLoad="javascript:setTimeout('window.location.reload()',5000);"





Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Auto reload page  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Validate textbox for HTML tags using javascript
Previous Resource: How to ADD textBox values in ASP.net using Javascript?
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

online optimum rewards

Contact Us    Privacy Policy    Terms Of Use