P
Paul Lee
Dear all,
This is related to a posting that I asked a few days ago, but it
subtly different.
We are trying to develop a webpage that displays an image from a
server side webcam every couple of second. My friend has come up
with some javascript code that seems to work, but what we would like
is the server side time that the image was taken, and we are thinking
about javabeans. Is there a way to mix java/javabeans and javascript to do this?
For your information, here is the javascript code:
<script LANGUAGE="JavaScript1.2">
// <!--
// Set the BaseURL to the url of your camera
// Example: var BaseURL = "http://172.21.1.122/";
var delay = 20000;
var BaseURL = "http://**.**.**.**/";
var Camera = "";
var ImageResolution = "704x576";
var DisplayWidth = "704";
var DisplayHeight = "576";
// No changes required below this point
var File = "axis-cgi/jpg/image.cgi?resolution=" + ImageResolution;
theDate = new Date();
var output = "<IMG SRC=\"";
output += BaseURL;
output += File;
output += "&dummy=";
output += theDate.getTime().toString(10);
// The above dummy cgi-parameter enforce a bypass of the browser image cache.
output += "\" HEIGHT=\"";
output += DisplayHeight;
output += "\" WIDTH=\"";
output += DisplayWidth;
output += "\" ALT=\"Webcam Display\"";
output += " NAME=\"WEBPIC\">";
document.write(output);
function update(){
var newpic;
theDate = new Date();
newpic = BaseURL;
newpic += File;
newpic += "&dummy=";
newpic += theDate.getTime().toString(10);
document.images["WEBPIC"].src = newpic;
setTimeout("update()", delay);
}
update();
// -->
</script>
Thanks for your help
Paul
This is related to a posting that I asked a few days ago, but it
subtly different.
We are trying to develop a webpage that displays an image from a
server side webcam every couple of second. My friend has come up
with some javascript code that seems to work, but what we would like
is the server side time that the image was taken, and we are thinking
about javabeans. Is there a way to mix java/javabeans and javascript to do this?
For your information, here is the javascript code:
<script LANGUAGE="JavaScript1.2">
// <!--
// Set the BaseURL to the url of your camera
// Example: var BaseURL = "http://172.21.1.122/";
var delay = 20000;
var BaseURL = "http://**.**.**.**/";
var Camera = "";
var ImageResolution = "704x576";
var DisplayWidth = "704";
var DisplayHeight = "576";
// No changes required below this point
var File = "axis-cgi/jpg/image.cgi?resolution=" + ImageResolution;
theDate = new Date();
var output = "<IMG SRC=\"";
output += BaseURL;
output += File;
output += "&dummy=";
output += theDate.getTime().toString(10);
// The above dummy cgi-parameter enforce a bypass of the browser image cache.
output += "\" HEIGHT=\"";
output += DisplayHeight;
output += "\" WIDTH=\"";
output += DisplayWidth;
output += "\" ALT=\"Webcam Display\"";
output += " NAME=\"WEBPIC\">";
document.write(output);
function update(){
var newpic;
theDate = new Date();
newpic = BaseURL;
newpic += File;
newpic += "&dummy=";
newpic += theDate.getTime().toString(10);
document.images["WEBPIC"].src = newpic;
setTimeout("update()", delay);
}
update();
// -->
</script>
Thanks for your help
Paul