W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: [DOMCore] fire and dispatch

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 25 Feb 2011 11:24:17 +0100
To: "Garrett Smith" <dhtmlkitchen@gmail.com>
Cc: "WebApps WG" <public-webapps@w3.org>
Message-ID: <op.vrge6qgl64w2qv@anne-van-kesterens-macbook-pro.local>
On Fri, 25 Feb 2011 04:05:44 +0100, Garrett Smith <dhtmlkitchen@gmail.com>  
wrote:
> OK. Why not expose a generic version of `fire` to the scripting  
> environment?

I do not know of any research (or have done any myself) as to how often  
such a feature might be useful for authors. While firing an event is  
currently a series of steps (using proposed optional arguments):

   var e = document.createEvent("Event")
   e.initEvent("test")
   dispatchEvent(e)

... it is not hugely complicated. (We could even make the argument to  
createEvent optional too and default it to "Event".) I could imagine  
having something like EventTarget.fireEvent(name) but if you want to get a  
little beyond the basics you will remain stuck with creating the event  
yourself.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Friday, 25 February 2011 10:24:52 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:43 GMT