source/src/System/EventManager.js
function (target, eventName, listener, useCapture) {
        var ver = System.utils.UserAgent.IE.getVersion();
        if (is(target, System.EventEmitter)) {
            target.on(eventName, listener, useCapture);
        } else if ((ver != -1 && ver <= 8) || is(target, Element)) {
            if (ver != -1 && ver < 11) {
                target.attachEvent("on" + eventName, listener, useCapture);
            } else target.addEventListener(eventName, listener, useCapture);
        }
        return target;
    }
function (target, eventName, listener, useCapture) {
        var ver = System.utils.UserAgent.IE.getVersion();
        if (is(target, System.EventEmitter)) {
            target.on(eventName, listener, useCapture);
        } else if ((ver != -1 && ver <= 8) || is(target, Element)) {
            if (ver != -1 && ver < 11) {
                target.attachEvent("on" + eventName, listener, useCapture);
            } else target.addEventListener(eventName, listener, useCapture);
        }
        return target;
    }
function ( target , eventName , listener , useCapture ) { var ver = System . utils . UserAgent . IE . getVersion ( ) ; if ( is ( target , System . EventEmitter ) ) { target . on ( eventName , listener , useCapture ) ; } else if ( ( ver != - 1 && ver <= 8 ) || is ( target , Element ) ) { if ( ver != - 1 && ver < 11 ) { target . attachEvent ( "on" + eventName , listener , useCapture ) ; } else target . addEventListener ( eventName , listener , useCapture ) ; } return target ; }
Adds a listener to the specified target.
@param target {Object} The target which will be observed.
@param eventName {String} The event name.
@param listener {Function} The listener instance.
@param useCapture {Boolean} True to use capture or False otherwise.
@returns Target object for chaining.
Adds a listener to the specified target .