For details about the extend () and fn. extend () methods in jQuery, jqueryfn. extend
The two methods use the same code. One is used to merge attributes and methods for jQuery objects or common objects. The other is an example of jQuery objects. for
Since it is a class, there is an abstract class, a specific class, and class inheritance. At the same time, the class members can have instance members and static members. Let's take a look at how prototype achieves this.
First look at the following
Jquery implements $. fn. extend and $. extend functions, jquery. extend
We have extended the bind method and the ready function. This time I will talk about the $. fn. extend and $. extend functions.
Let's talk about other theme topics!
Let's take a
JQuery. extend functions and Usage Details, jquery. extend usage
Jquery. extend function details
Extends of JQuery:
The Extension Method extend of Jquery is a commonly used method in the process of writing plug-ins. This method has some heavy-load
Since it is a class, there is an abstract class, a specific class, and class inheritance. At the same time, the class members can have instance members and static members. Let's take a look at how prototype achieves this.First look at the following
The source code is as follows:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->VaR abstract = new object ();
Object. Extend = function (destination, source ){
For (property in source ){
Destination
Prototype (III): object. Extend
The class definition is mentioned above. Prototype distinguishes functions from classes by using a global object class. Since it is a class, there is an abstract class, a specific class, and class
Jquery provides two methods for development plug-ins:
JavascriptCode
Jquery. FN. Extend (object );
Jquery. Extend (object );
Jquery. Extend (object); adds a new method to the class to extend the jquery class itself.
Jquery. FN.
Implementation of extend in jquery
Generally, when we use the extend of jquery, most of them are used to overwrite the default field. That is, if the value of a field is input, the input value is used; otherwise, the default value is used. The
Anyone who knows about extension of jQuery objects who has written jquery plug-ins knows that extends provided by jquery can be used to expand jquery objects. In addition, this method can not only expand jquery objects, you can also add new
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.