My web application uses document.createEvent and event.initEvent to create custom events of the generic type Event .
I wonder if this is considered good practice. On the other hand, I can use the DOM event system that already exists, and I do not need to invent and implement my own; on the other hand, this can lead to name conflicts if future standardized event models determine the type of event with the name that I have chosen. (Or is this possible for event type names?)
I ask because I just found out by looking at stackoverflow that sets custom properties for DOM objects or inline Javascript objects is considered bad practice.
EDIT I think I found something: http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-CustomEvent
So let me rephrase my question: Do I understand the cited section correctly in that it is recommended to use CustomEvent inside a web application?
ADDITIONAL WARNING I just noticed that CustomEvent not supported in versions of Firefox prior to 6. It is supported in current Webkit-based browsers.
Marc
source share