Dynamic updates

Discussion in 'ASP General' started by Dev880, Oct 27, 2004.

  1. Dev880

    Dev880 Guest

    I need to know if I should use asp.net or Java for this. I would like to use
    asp in general.

    I need to have a function check to see if a variable is true or false and
    update an icon. But I want it to either check when updated or every 3
    seconds. I suppose it has to be somewhat client side scripting but is there a
    way around this. As of now I use IFrames whith a refresh of 10 seconds, any
    less will cause it to timeout. I kind of want it real-time or very near. It's
    kind of like a status page for information in a database. Any suggestions?

    Thanks
     
    Dev880, Oct 27, 2004
    #1
    1. Advertising

  2. <html><body onload="checkImage();">
    <script type="text/javascript">
    function checkImage() {
    document.images['x'].src='image.asp';
    window.setTimeout('checkImage()',300);
    }
    </script>
    <img name="x" src="">
    </body>
    </html>


    Where image.asp looks like:

    <%
    If Second(Time) Mod 2 = 0 Then
    sImage = "even.gif"
    Else
    sImage = "odd.gif"
    End If
    Response.Redirect sImage
    %>

    Ray at work

    "Dev880" <> wrote in message
    news:D...
    >I need to know if I should use asp.net or Java for this. I would like to
    >use
    > asp in general.
    >
    > I need to have a function check to see if a variable is true or false and
    > update an icon. But I want it to either check when updated or every 3
    > seconds. I suppose it has to be somewhat client side scripting but is
    > there a
    > way around this. As of now I use IFrames whith a refresh of 10 seconds,
    > any
    > less will cause it to timeout. I kind of want it real-time or very near.
    > It's
    > kind of like a status page for information in a database. Any suggestions?
    >
    > Thanks
     
    Ray Costanzo [MVP], Oct 27, 2004
    #2
    1. Advertising

  3. Whoops. Make that 3000, not 300 in setTimeout. :]

    Ray at work

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > <html><body onload="checkImage();">
    > <script type="text/javascript">
    > function checkImage() {
    > document.images['x'].src='image.asp';
    > window.setTimeout('checkImage()',300);
    > }
    > </script>
    > <img name="x" src="">
    > </body>
    > </html>
    >
    >
    > Where image.asp looks like:
    >
    > <%
    > If Second(Time) Mod 2 = 0 Then
    > sImage = "even.gif"
    > Else
    > sImage = "odd.gif"
    > End If
    > Response.Redirect sImage
    > %>
    >
    > Ray at work
    >
    > "Dev880" <> wrote in message
    > news:D...
    >>I need to know if I should use asp.net or Java for this. I would like to
    >>use
    >> asp in general.
    >>
    >> I need to have a function check to see if a variable is true or false and
    >> update an icon. But I want it to either check when updated or every 3
    >> seconds. I suppose it has to be somewhat client side scripting but is
    >> there a
    >> way around this. As of now I use IFrames whith a refresh of 10 seconds,
    >> any
    >> less will cause it to timeout. I kind of want it real-time or very near.
    >> It's
    >> kind of like a status page for information in a database. Any
    >> suggestions?
    >>
    >> Thanks

    >
    >
     
    Ray Costanzo [MVP], Oct 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary
    Replies:
    7
    Views:
    4,912
    Joe Smith
    Jan 20, 2004
  2. dbuchanan
    Replies:
    0
    Views:
    445
    dbuchanan
    Dec 12, 2005
  3. =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==

    Dynamic page updates using XMLHTTP

    =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==, Aug 7, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    460
    =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==
    Aug 8, 2007
  4. markla
    Replies:
    1
    Views:
    418
    Allen Chen [MSFT]
    Oct 15, 2008
  5. Doug Beaver
    Replies:
    0
    Views:
    132
    Doug Beaver
    Dec 17, 2005
Loading...

Share This Page