Let’s make it clear: without events, there would be no point in adding JavaScript to Web pages.
To be effective, therefore, scripts have to react to some user action as well as to actions generated
by the browser, such as when loading the page. Events and event handlers are old companions
to Web pages, as they appeared the first time with Netscape 2.
For quite some time, largely incompatible event models lived and thrived in different
browsers—mainly in Internet Explorer and Netscape. A few years ago, the W3C standardized
the event model with a paper that you can read at http://www.w3.org/TR/2000/
REC-DOM-Level-2-Events-20001113/events.html.
With Internet Explorer and Netscape having their own original event model, and making
themselves compatible to the W3C standard, you understand that writing model-agnostic
event handlers is going to be a hard task. There are a lot of events, but not all of them are supported
by all browsers. The following categories of events can be considered standard: user
interface events (blur, focus, scroll), device events (click, keydown), and form events (submit,
select). The second big point concerns how you set event handlers. The most reliable way is
still the following:
An excellent paper that discusses the theme of events in JavaScript can be found here: http://
www.quirksmode.org/js/introevents.html.
Tip : If you’re looking for a great Web site to learn about the various aspects of JavaScript,
DHTML, DOM, CSS and client-side programming in general, the right place to go is
http://www.quirksmode.org.
Category :
- ASP.NET AJAX in Person (1)
- Conclusion (1)
- The AJAX Core Engine (1)
- The AJAX Revolution (1)