Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh page without showing refresh?

    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!

  • #2
    Regular Coder
    Join Date
    Oct 2007
    Location
    Glencoe, Ontario, Canada
    Posts
    340
    Thanks
    19
    Thanked 27 Times in 27 Posts
    thats a javascript related question.

    Code:
    <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.
    Last edited by PitbullMean; 02-15-2009 at 09:11 PM.
    Eric "PitbullMean" Melo
    Always Start your layout with*{border:0; margin:0; padding:0;}
    Be sure to Thank ALL Users who give assistance.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •