473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image event counter

Hi
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>
Any help would be greatly appreciated.
Regards, Carl Gilbert.
Jul 20 '05 #1
2 1635
"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.'
Jul 20 '05 #2
"Carl Gilbert" <ca**********@ntlworld.com> wrote in message
news:rR**************@newsfep1-gui.server.ntli.net...
....
| <SCRIPT LANGUAGE="JavaScript" FOR="CamImage1"
EVENT="onNewImage()"></SCRIPT>

Please note that Java and JavaScript are
different languages, for JavaScript, see...

comp.lang.javascript

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carl Gilbert | last post by:
Hi I'm having problems with the following code. All I want to do is keep a counter on the page for every new image recieved without deviating from the "for" and "event". <OBJECT ID="CamImage1"...
15
by: Jose Michael Meo R. Barrido | last post by:
Hi! Can u please tech me a way to know if the image in the picturebox has changed? what event should i catch the chage?
0
by: sakieboy | last post by:
In ASP.Net VB, is there a way to capture a Click on image event? Currently, I have a user control that consists of a button, calendar, and text box. User selects the button and the calendar...
7
by: JellyON | last post by:
Hi. Is there a way to delay a call to a page counter (ie. call to a server script from an IMG tag) for the purpose to not lock the page loading awaiting counter be displayed. Maybe a...
4
by: Tomasz Bak | last post by:
Hello, I have a simple problem: mark a list of defects on an image. I think the best way to do it is to select a single deffect, then take two coordinates of coursor form an image on a web...
1
by: Ernst Lindner | last post by:
Hello, hopefully somebody can help me. In my homepage I would like to install a picture gallery (small pictures). If the user places the mouse over a picture, by using the event handler...
4
by: Mark S. | last post by:
Hello, On a high volume page we have the following JavaScript: img = new Image() img.src = 'http://myserver.com/count.aspx?x=1'; and it works fine, but now we've added: img.onload =...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.