Problem with bind() and some events in IE 9
|Reported by:||Owned by:|
Example at http://jsfiddle.net/38szJ/ When ran in IE 9 standards mode will alert "false" (wrong). When ran in IE 9 Compat view or IE 8 will alert "true" (right). Other browsers do now support this event so only IE is affected.
The bind() method uses feature detection to decide how to attach an event to an element. First it checks for "addEventListener" (DOM Events) and then "attachEvent" (IE specific implementation). IE 9 supports both "addEventListener" and "attachEvent" but IE 8 and bellow only support attachEvent.
The problem is that some IE specific events in IE 9 (e.g. onpropertychange - http://msdn.microsoft.com/en-us/library/ms536956(v=vs.85).aspx ) must be added using "attachEvent" and NOT "addEventListener". Since the code in first checks for "addEventListener" and IE 9 supports that as well, IE specific events will not be registered correctly using bind().
Change History (11)
comment:1 Changed 6 years ago by
|Component:||unfiled → event|
|Owner:||set to bit@…|
|Priority:||undecided → blocker|
|Status:||new → pending|