The dispatchEvent Method


The dispatchEvent Method

The dispatchEvent method is a W3C method that enables you to send an event to an object. This is the W3C way of triggering events, as opposed to methods such as the click method. You can see the support for this method in Table 6.17.

Table 6.17. The dispatchEvent Method

Method

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

dispatchEvent( eventObject )

     

x

           
 

Returns: Boolean

To use this method, you use the document method createEvent to create an event object, and then pass the event object to the object in which you want to trigger the event. This method returns a value of true if the event was dispatched successfully, false otherwise .



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net