IT.COM

Keep last image while new one loading

Spaceship
Watch
Hello everybuddy!

I'm esigning a little service for mobile accesses. There's a page that continuosly refresh a target image on a url. This image is provided by a webcam and changes periodically, one or two images every second.

The problem is that when I refresh this image, of course it appears a blank page until it finish loading.

My goal is to keep the last loaded image until the new one finishes loading.

Could somebody help me??

The code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ page language="java" %>



<html>

<head>

<title>Camara</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

<!-- <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> -->

<script language="JavaScript">

function recarga(){

location = this.location;

}

</script>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="barra">

  <img width="159" height="130" src=<%=request.getParameter("camara") + "?Type=0&Img=" + request.getParameter("Img")+"&Q="+request.getParameter("Q")%>>

<br>

<script>

setTimeout("recarga()",4000)

</script>

</body>

</html>

Thanks in advance,



Ronnie.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
hmmmmm sorry cant help you (not familar with the language your using)

but is there any paticular reason for this?
 
0
•••
Any language is okay

I don't mind which language I should use to obtain this feature working. Any language is okay.

My unique limit is mobile phones web viewers'. But normally they accept html and you can use any server language.

Thanks.
 
0
•••
hmmmmmm its not possible is it because even if you have the page loading its still gotta "refresh" to load the new one, only way i can think is flash
 
0
•••
Would it help if you were able to auto-refresh the image without reloading the entire page?

<html>

<head>

<title>Camara</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

<!-- <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> -->


<script language="JavaScript">
function recarga() {
if (!document.images) return;
document.images['camara'].src = '<%=request.getParameter("camara") + "?Type=0&Img=" + request.getParameter("Img")+"&Q="+request.getParameter("Q")%>?' + Math.random();
setTimeout('recarga()',4000);
}

</script>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="barra" onLoad=" setTimeout('recarga()',4000)">

<img width="159" height="130" src=<%=request.getParameter("camara") + "?Type=0&Img=" + request.getParameter("Img")+"&Q="+request.getParameter("Q")%> name="camara">

<br>

</body>

</html>

You would need to have from document.images['camera'] to Math.Random(); all on one line.

I don't know, maybe it will work :-/ :D
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back