Auto Refreshing Page with Timing Specified by You in JavaScript

Hi,

This Code contains of Script in Java which Refresh your Web Page with the Time Mentioned by You.



<script>
<!--

//enter refresh time in "minutes:seconds"
// Minutes should range from 0 to inifinity.
//Seconds should range from 0 to 59
var time="0:30"

if (document.images){
var parselimit=time.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
-->
</script>


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: