jQuery 1.0.4 - New Wave Javascript(js源文件)

2019-06-03 09:49:42刘景俊

     */
    event: {

        // Bind an event to an element
        // Original by Dean Edwards
        add: function(element, type, handler) {
            // For whatever reason, IE has trouble passing the window object
            // around, causing it to be cloned in the process
            if ( jQuery.browser.msie && element.setInterval != undefined )
                element = window;

            // Make sure that the function being executed has a unique ID
            if ( !handler.guid )
                handler.guid = this.guid++;

            // Init the element's event structure
            if (!element.events)
                element.events = {};

            // Get the current list of functions bound to this event
            var handlers = element.events[type];

            // If it hasn't been initialized yet
            if (!handlers) {
                // Init the event handler queue
                handlers = element.events[type] = {};

                // Remember an existing handler, if it's already there
                if (element["on" + type])