Recently I came across the key differences in the w3c event model and the event model followed by microsoft( its for the IE ghost which haunts many !!)
I am listing the major differences here :
Points | W3C event Model | Microsoft event model |
---|---|---|
Nomenclature | It is called the W3C event model | It is called JScript event model |
API used : | object.addEventListener(event,function,useCapture) | object.attachEvent(event,function) |
The this object | this object points to the object to which event is attached to |
this points to the window object |
event object | It allows event object to be passedas first argument of the listener functionthus we can do $event.preventDefault(); | It provides a window.eventobject.Thus to do the same thing you have to setthe returnValue property of window.event object to false |
Scope of event object | The event object is not global | The event object is always global |
Standardized methods for event object | the event object provides many standardized methods | the event object does not provide the same standardized methods |
Compatibility !! | It is supported by all browsers | Supported by microsoft browsers only ! |