What is jQuery core object?
$ $===jQuery
What is jQuery's prototype object?
$.fn $.fn===$.prototype
What is a static method?
In the trees defined constructor method, a static method to call the constructor. For example: Math.random ()
What is the dynamic method?
Dynamic method is also known as an instance method, the method added in the prototype object called dynamic methods, by instance objects to call. For example: arr.slice ()
JQuery static methods and dynamic methods?
JQuery extensions to time, there are two ways, one is $ .extend () of methods for a $ .fn way, $. Extend () extension is a static method, $. Fn extension is dynamic method.
Static method using jQuery core object to call, that is, to call with $, dynamic method with jQuery's prototype object to call, that is, with a $ .fn to call.
Now jQuery extension method to get a random color:
In other words, use $ .extend () jQuery is to add a static method call with $, $ .fn is to use JQuery to add a dynamic method, .fn called with $ use use .
$ Called core object, $. Fn called a prototype object.
typeof $--------->function
typeof $.fn--------->object
$ Equivalent class, a class method called directly, $. Fn corresponding to the object instance, the object instance to invoke a method.