...

View Full Version : Refresh page without showing refresh?



esim03
02-15-2009, 07:57 PM
Hi,

Basically, what I'm trying to do is to have a portion of my page constantly update itself. More specifically, I'm going to have a bunch of JPEGs constantly being streamed in, so I have the client's browser refreshing itself - as a result, the whole browser has to update, too (the title updates, the refresh button gets pressed, the hourglass is always showing, etc.).

I have a servlet and I tried HTML with the meta-refresh tag, javascript, and then I tried frames, but no matter what I try the same annoying problem comes up.

Is there anyway to have a part of the page update itself without all of the above happening? (The images can't be preloaded). Thanks guys!

PitbullMean
02-15-2009, 08:05 PM
thats a javascript related question.


<script language="JavaScript">

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

</script>


<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>

<script>

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 <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> 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 <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}

if (document.all||document.getElementById)
startit()
else
window.onload=startit

</script>


Anyway that should be what u need.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum