Tutorial: HTML / JavaScript
Auto Refresh 2
 

Want to refresh certain page after certain time interval? Well, there are 2 ways of doing it… I explained the 1st way here. But if you’re using that way, the page will only refresh after the page has finished loading.

Here’s another way of doing it, which will guarantee the page to be auto refreshed after stated interval of time.

 

- Just copy the following code, and paste it in the page where you want it auto reload


<script language="JavaScript">

//Refresh page script- By Brett Taylor (glutnix@yahoo.com.au)
//Modified by Dynamic Drive for NS4, NS6+
//Visit http://www.dynamicdrive.com for this script

//configure refresh interval (in seconds)
var countDownInterval=60;
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200

</script>

<ilayer id="c_reload" width=&{c_reloadwidth}; >
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location.reload()
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next refresh in '+countDownTime+'  seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 1000);
}

function startit(){
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('Next 

 

- The most important thing you will need to change is this part;

var countDownInterval=60;

 

- The 60 value represent the refresh interval in seconds…


 

 

 


 

Avarage Rating:  from 3 votes.
 
Rate This Page;

 

 

Comment? »

 

 

Leave a comment
 

 Name (required)

 E-mail (required,not published)

 URI

 

 

 

 
 

Advertisements
 
Must clicks!

Click Here to Advertise On My Blog
...also get paid to blog!

lady
 
ajwa . Naj . Wawa . 26 . . 290 days until my 27th birthday on May 18th . IT Engineer . Malaysian . Dreamer . Worrier . Simple . Boringgg . but Laughs a lot . Gaining back her self-confidence ♥ Mariah carey . David Archuleta . Michael Bublé . James Morrison . Anuar Zain . Akim . Faizal Tahir . Diddy . Jesse McCartney . Linkin Park . BSB . *N Sync . Rascal Flatts . Smallville . Charmed . One Tree Hill . Merlin . Summerland . The City . Jonas . Matrix Trilogy . LOTR . Star Wars Saga . Twilight Saga . The Covenant . Taylor Lautner . Tom Welling . Paul Walker . Steven Strait . Hugh Jackman . Josh Hartnett . Chad Michael Murray . Ewan McGregor . Natalie Portman . Cameron Diaz

?

playlist cam cam
 
facebook twitter yahoo! messenger youtube

 
Your Text Ads Here?
 

 

navigate
 
Journal
Lady
Artwork
Collective
Visitor
        Graphics
        Downloads
        Scripts
        Reads
        Games
        Interactive
        Tutorial
 
Plugboard
Exits
SecretWhisper

 

skins





skins more?

 

stats
 
3 online currently,
181 cried on this page,
342378 were all cried out,
Since 29-Jan-2006

Powered by  MyPagerank.Net

 

random links
 
Syamelia * Guilty Indulgence
Deida
Monchiano's™
Just Sya
Nad The Pinky Gurl
Kematz
Mapple Berry
Gadaffi Ruslan
I'm Just A Boy Next Door
Tira Blurb
TenshiMon.com
Star-Lett.net
Yoyooh.com
Paddling-Geek.net
Forgotten-Smile.com
AndyzWeb
Beyond The Sign
AisyahRozi.com
SwayMyWay.com
Hardstar.org

link exchanges more?

 

Follow Me


 

etcetera

 

 
Earn Money Online?
Free Domain?
 

 
 Search the web/site.
Web SawYouCry

 

 

© Najwa 2005-08
SecretWhisper Production
All rights reserved.
* * * * * * * * * * * * *