Was the idea of allowing custom event types ever discussed for HTML5? Correct me if I'm wrong, but currently the document will only propagate events of known types (<code>UIEvents </code><code>MouseEvents</code> <code>MutationEvents </code><code>HTMLEvents</code>), and you can't add other event types to propagate via dispatchEvent()?<br>
<br>I was trying to use the addEventListener()/dispatchEvent() model to distribute events in my (javascript) app. I thought I would be able to do:<br> mydiv.addEventListener('my_event_1', cb, false);<br><br>and later:<br>
mydiv.dispatchEvent(evt);<br><br>However, to do this I needed to create an event object (evt) and when I tried to create an event using document.createEvent() it seemed I could only use pre-existing event types.<br><br>
For someone writing any kind of Javascript toolkit it seems this would be useful.<br><br>var evt = document.createEvent("ApplicationEvent");<br>evt.initEvent("my_event_1");<br><br><br><br>Thanks, <br>Rik.<br>
<br><br clear="all">Rik Sagar, San Jose, CA 95124<br>Visit : <a href="http://sagar.org/">http://sagar.org/</a><br> <br>