"Carl Gilbert" <ca**********@ntlworld.com> writes:
I am looking to generate a counter based on the following event. The event
is generated every time a new image is recieved and this is what I need to
count.
<SCRIPT LANGUAGE="JavaScript" FOR="CamImage1" EVENT="onNewImage()"></SCRIPT>
The "for" and "event" attributes are non-standard (IE specific I believe).
You don't need them either.
The event you are looking for is the "load" event (aka "onload").
Try this:
<script type="text/javascript">
var counter = 0;
function countUp() {
counter ++;
}
document.images['CamImage1'].onload = countUp;
</script>
Put this after the image in the page.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'