Skip to content

Commit 5280097

Browse files
committed
fixed feature detection issue
1 parent d458abc commit 5280097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

function-patterns/init-time-branching.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
addListener: function (el, type, fn) {
1616
if (typeof window.addEventListener === 'function') {
1717
el.addEventListener(type, fn, false);
18-
} else if (typeof document.attachEvent === 'function') {
18+
} else if (typeof document.attachEvent !== 'undefined') {
1919
el.attachEvent('on' + type, fn);
2020
} else {
2121
el['on' + type] = fn;
@@ -36,7 +36,7 @@
3636
utils.addListener = function (el, type, fn) {
3737
el.addEventListener(type, fn, false);
3838
};
39-
} else if (typeof document.attachEvent === 'function') { // IE
39+
} else if (typeof document.attachEvent !== 'undefined') { // IE
4040
utils.addListener = function (el, type, fn) {
4141
el.attachEvent('on' + type, fn);
4242
};

0 commit comments

Comments
 (0)