Created
February 23, 2015 16:07
-
-
Save franklinjavier/562ebd242fbab9c7aa75 to your computer and use it in GitHub Desktop.
Attach event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Attach event | |
| * @param {Object} o DOM Element | |
| * @param {string} e Event name | |
| * @param {Function} f Function | |
| */ | |
| var ea = function(o, e, f) { | |
| try { | |
| o.addEventListener ? | |
| o.addEventListener(e, f, !1) : | |
| o.attachEvent && o.attachEvent('on' + e, f); | |
| } | |
| catch (e) {} | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment