Dynamic updates

D

Dev880

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
 
R

Ray Costanzo [MVP]

<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
 
R

Ray Costanzo [MVP]

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

Ray at work

Ray Costanzo said:
<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 said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top