jQuery 1.4.2 VSDoc

前端 未结 15 595
夕颜
夕颜 2020-12-02 14:12

Where can I get the VSDoc for jQuery 1.4.2?

15条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 14:52

    The adventurous can add the following lines starting at 2949:

    delegate: function( selector, types, data, fn ) {
    /// 
    ///   Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. See also "live".
    /// 
    /// 
    ///     An expression to search with.
    /// 
    /// 
    ///     A string containing a JavaScript event type, such as "click" or "keydown".
    /// 
    /// 
    ///     A map of data that will be passed to the event handler.
    /// 
    /// 
    ///     A function to execute at the time the event is triggered.
    /// 
        return this.live( types, data, fn, selector );
    },
    undelegate: function( selector, types, fn ) {
    /// 
    ///   Remove a handler from the event for all elements which match the current selector, now or in the future, based upon a specific set of root elements. See also "die".
    /// 
    /// 
    ///     An expression to search with.
    /// 
    /// 
    ///     A string containing a JavaScript event type, such as "click" or "keydown".
    /// 
    /// 
    ///     A map of data that will be passed to the event handler.
    /// 
    /// 
    ///     A function to execute at the time the event is triggered.
    /// 
        if ( arguments.length === 0 ) {
                return this.unbind( "live" );
    
        } else {
            return this.die( types, null, fn, selector );
        }
    },
    

    That documentation is pretty much ripped from jQuery web pages and from current definitions of "live" and "die", but feel free to adjust as you see fit.

    Also, at line 224:

    // The current version of jQuery being used
        jquery: "1.4.2",
    

提交回复
热议问题