Event handling is the core technique, which can be used while interacting with the user. Events are complex matters and are defined in W3C, which are tough terms to understand. Event triggers the function when something happens to the main document.
Framework code or hand code method is used for event handling. In the window we add handlers to define the events. As these web interfaces is facing changes there should be a change in HTML tags as well as Java script.
DOM Event Model is an advanced working approach. It can be explained as follows:
An event occurs when something happens. This is Event Capturing. These events happen by questioning each element from the window to the body of the child node, until the event target is reached and the element is activated. When the element is reached, it is reported back through DOM and is called Event Bubbling.
The events can be intercepted at any point of time. Event listener clarifies the type of event they are looking for, either by key press or mouse down. The events can be stopped from going back to the window by a method called ‘Cancel Event’ or to get back to event target ‘Get Target’ is used. These events help adding many listeners for different events.
Understanding events and applying them will free you from restricted elements. There is no need to change the script when there is an increase in menu or links.
Event delegation is a very powerful as well as a flexible approach. They allow assigning different handlers to menus, submenus, contents, sidebars in the document and defining their method for event.
While using these ideas we depend on the browser report, which is the DOM event. Actually this method is totally unnecessary as it restricts the application. Apart from DOM event there is Custom event object. This defines any event and subscribes the listener method via YUI (User Interface Library).
So a lot of events are discussed, which can be planned in a
web development for making easy changes and maintaining and extending the website.
