Auto refresh page using Javascript
Auto refresh page using Javascript
Auto refresh page using Javascript
Actually this javascript program have been there long since javascript is made. But getting a page refreshed within a specific time frame is a great thing to get added to your website. In this script we can implement a timer which displays a countdown before the web page gets refreshed.
Code explanation:- For the code below I am setting time limit as 30 seconds. parselimit variable will have the time in seconds. For example if you are setting limit as one minute and thirty seconds (1:30), then this will be converted to seconds by the variable parselimit.
The main code will come under function named beginrefresh from where it basically checks whether variable parselimit is equal to one then reload the web page otherwise keep decrementing the time.
Countdown will be shown in the div with id=”status”
<script> //enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. / / enter refresh time in "minutes: seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59 Seconds should range from 0 to 59 var limit="0:30" parselimit=limit.split(":") parselimit = parselimit [0] * 60 + parselimit [1] * 1 function beginrefresh(){ 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!" document.getElementById("status").innerHTML=curtime setTimeout("beginrefresh()",1000) } } window.onload=beginrefresh </script> <div id="status"></div>
You can use this web page to call some Database page or something similar that needs to be refreshed after a specific time period.
Auto refresh page using Javascript,Incoming search terms:
- Refresh the page in a few minutes (313)
- javascript auto refresh page with timer (96)
- fungsi reload current page pada internet explorer (86)
- fungsi reload current page (62)
- javascript auto refresh timer (33)
- •Refresh the page in a few minutes (30)
- javascript refresh page timer (21)
- javascript auto refresh with timer (18)
- yhs-fh_lsonsw (17)
- Auto refresh page with timer (16)
- auto refresh timer in javascript (13)
- javascript refresh timer (13)
- javascript automatic refresh timer (12)
- javascript page refresh timer (10)
- javascript timer refresh (8)
- javascript refresh page (4)
- efresh the page in a few minutes (3)
- very simple javascript auto refresh (3)
- javascript page reload timer (2)
- javascript retresh page by timer (2)
- jquery reload page timer (2)
- Refresh time in seconds (2)
- jquery refresh page on timer (2)
- how to refresh form by onload (1)
- how to refresh html page using timers (1)
- java auto select link timer (1)
- java countdown timer reload page (1)
- How to make a countUP/Down timer with promt in HTML and Javascript (1)
- how to auto refresh another page from another page in javascript (1)
- asp net page countdown timer that refreshes page (1)
- auto refresh time remaining in javascript (1)
- auto refresh until link to other page (1)
- auto refresh with timer (1)
- auto time to refresh (1)
- click tag to reload page javascript (1)
- apakah fungsi reload current pada internet explorer? (1)
- countdown timer to refresh screen after success message in php (1)
- fungsi refresh image (1)
- code for javascript page refresh timer (1)
- getripz pl The download failed Refresh the page in a few minutes (1)