| View previous topic :: View next topic |
| Author |
Message |
Opaque
Joined: 13 Dec 2006 Posts: 1
|
Posted: Wed Dec 13, 2006 9:11 pm Post subject: refresh image source only |
|
|
I would like to refresh the following code only, every 5 seconds.
The code sends a variable to a php script. user=atodd is the variable and must stay in the code.
<img src="is_online/is_online.php?user=atodd"/>
Any help would be greatly appreciated. |
|
| Back to top |
|
 |
|
|
ngpgeeta
Joined: 18 Nov 2006 Posts: 19
|
Posted: Sun Dec 17, 2006 9:24 am Post subject: Re: refresh image source only |
|
|
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function calling()
{
timer=setTimeout("imgrefresh()",5000)
}
function imgrefresh()
{
g.innerHTML="<img src='one.jpg' width=100 height=300>"
clearTimeout(timer)
}
</script>
</HEAD>
<BODY onload="calling()">
<div id="g"></div>
</BODY>
</HTML>
This will load the image after 5 sec. If you want continous loading of the image, after the line clearTimeout(timer), write calling(). This will again call imgrefresh after every 5 seconds. Take care if you call calling() continously, this may hang your system. |
|
| Back to top |
|
 |
|