Best Approach for Real-Time Page updating

Discussion in 'HTML & Website Design' started by snoop911, Sep 19, 2009.

  1. #1
    Hi,

    What's the best way to constantly refresh a web page?

    I'm running a local webserver, not connected to the internet, that serves up data from a sprinkler valve.

    AFAIK, there is nothing on the server side that I can do to 'push' a new web page as soon as valve data changes, so I'm looking to write a simple page that constantly refreshes itself in order to display the latest data.

    Not sure what the best way to go about it, perhaps they are all the same, with none of them being truly real-time (i.e. < 1sec)...

    <META HTTP-EQUIV=Refresh CONTENT="1; URL=http://192.168.1.1/mypage">

    or using javascript..
    window.location.replace( sURL )
    window.location.reload( true );

    jquery...
    http://www.codenothing.com/archives/snippets/jquery-refresh

    What's the best way to update the client browser as soon as the webserver has an updated webpage?

    Thanks!
     
    snoop911, Sep 19, 2009 IP
  2. sethyr

    sethyr Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Maybe try using ajax?
     
    sethyr, Sep 20, 2009 IP