Problem with bind() and some events in IE 9
|Reported by:||bit@…||Owned by:||bit@…|
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 5 years ago by rwaldron
- Component changed from unfiled to event
- Keywords needsreview added
- Owner set to bit@…
- Priority changed from undecided to blocker
- Status changed from new to pending
comment:3 Changed 5 years ago by dmethvin
- Priority changed from blocker to high
- Status changed from open to pending