Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this message<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" <Dev880@discussions.microsoft.com> wrote in message
news:D5E63A94-3D3F-4888-B946-448830187A24@microsoft.com...
>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
Post Follow-up to this messageWhoops. 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:uo9JymEvEHA.2876@TK2MSFTNGP12.phx.gbl...
> <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" <Dev880@discussions.microsoft.com> wrote in message
> news:D5E63A94-3D3F-4888-B946-448830187A24@microsoft.com...
>
>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.