What does jQuery.fn mean?

前端 未结 4 1539
说谎
说谎 2020-11-22 09:03

What does the fn here mean?

jQuery.fn.jquery
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 09:43

    jQuery.fn is defined shorthand for jQuery.prototype. From the source code:

    jQuery.fn = jQuery.prototype = {
        // ...
    }
    

    That means jQuery.fn.jquery is an alias for jQuery.prototype.jquery, which returns the current jQuery version. Again from the source code:

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

提交回复
热议问题