Auto Refresh

Discussion in 'WordPress' started by nickyj83, Apr 18, 2008.

  1. #1
    How can i auto refresh my wordpress blog every 2 minutes?

    Its ok now, its sorted if anyone else need to know how. Just place this code inbetween you <head> tags, in your header .php.

    Just change the var limit="2:00" to how long you wish!


    <script>
    <!--

    /*
    Auto Refresh Page with Time script
    By JavaScript Kit (javascriptkit.com)
    Over 200+ free scripts here!
    */

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

    if (document.images){
    var parselimit=limit.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>
     
    nickyj83, Apr 18, 2008 IP
  2. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Why do you need to auto refresh your blog?
     
    mizaks, Apr 18, 2008 IP
  3. CountryBoy

    CountryBoy Prominent Member

    Messages:
    8,970
    Likes Received:
    754
    Best Answers:
    0
    Trophy Points:
    360
    #3
    I'd avoid doing that if you're using AdSense or similar: they might think you're trying to diddle the system by ramping your impressions.
     
    CountryBoy, Apr 18, 2008 IP
  4. nickyj83

    nickyj83 Well-Known Member

    Messages:
    491
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #4
    its a livescores blog
     
    nickyj83, Apr 19, 2008 IP
  5. UIS4821

    UIS4821 Peon

    Messages:
    354
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What is the benefit of auto refreshing constantly?
     
    UIS4821, Apr 19, 2008 IP
  6. ruby90

    ruby90 Peon

    Messages:
    721
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    In firefox 2.0.0.4 I'm using it have feature which can set time for auto refreshing :p
     
    ruby90, Apr 19, 2008 IP
  7. a!!!!1

    a!!!!1 Peon

    Messages:
    346
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Maybe he updates 20+ times a day and wants readers to immediately see the new topics
     
    a!!!!1, Apr 19, 2008 IP
  8. nickyj83

    nickyj83 Well-Known Member

    Messages:
    491
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #8
    It refreshes so the livescores are up to date. There is no point having a scores which isnt live! Hence i needed the page to refresh.
     
    nickyj83, Apr 20, 2008 IP