[Javascript] .fireEvent("onchange") and .onchange();

SMartin at neopostonline.com SMartin at neopostonline.com
Tue Apr 9 13:27:50 CDT 2002


fireEvent() allows you to, well, fire an event programatically and to create
your own event handlers.  When you use fireevent for a default behavior and
event handler, you're going through some extra layers to get to basically
the same programming block.  Thus, you're better off sticking with the
default event handler (in this case onChange()) rather than bothering with
fireEvent.  For more details on the fireEvent method, see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht
ml/letmthfireeventBHV.asp

-----Original Message-----
From: Peter-Paul Koch [mailto:gassinaumasis at hotmail.com] 
Sent: Tuesday, April 09, 2002 4:28 AM
To: javascript at LaTech.edu
Subject: Re: [Javascript] .fireEvent("onchange") and .onchange();



>I work with IE6. Can someone tell me what is the difference between the
>methods: fireEvent ("onchange") and onchange ()?

fireEvent() is a MS only method while onchange() is cross-browser.

>for example, I have a checkbox: myCheckbox; I can use 
>myCheckbox.fireEvent
>("onchange") or myCheckbox.onchange (). It seems to do the same think, but 
>fireEvent method takes much more time (with very many objects). Can you 
>tell me why?

Dunno, never tried it. But use onchange() anyway, since it works everywhere.

ppk

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list