Display Images

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web page to work as Video Web Viewer. It pulls image from IP camera using JavaScript. It works great in most of time. When users are in slow network,

the Internet Explore begins to display part of the image before the image is fully downloaded, so the video looks like broken sometimes.

I remember that web Brower used to have an option <Show Picture after Downloaded>. I can not find it in Internet Explore settings. Your advices on JavaScript or

Web Brower setting are high appreciated. I don't want to use Java in this page. Thanks

Here is the sample code:

<HTML><HEAD><SCRIPT language="Javascript"
var imgURL = "http://ipaddress/image.aspx"
function Image_onload() {
document.xxxx.imgCamera.src = imgURL + '&' + (new Date().getTime());;

</SCRIPT></HEAD><body
..
<IMG name="imgCamera" onload="Image_onload();" src="http://ipaddress/image.aspx"></IMG
..
</body><
 
Hi

The standard is doing it with JavaScript..

function getImg(sSrc){
var i = new Image();
i.src = sSrc;
i.onload = dispPic;
i.onerror = errHandler;
}

function dispPic(){
document.images["TARGET_IMG_NAME"].src = this.src;
}

function errHandler(){
alert("Error getting image");
}

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
 
Back
Top