A key function of jQuery. It is a key function of jQuery.
JQuery. extend = jQuery. fn. extend = function (){
// Copy reference to target object
Var target = arguments [0] | |{}, a = 1, al = arguments. length, deep = false;
// Handle a deep copy situation
// This IF condition is basically always false. It is true only when the target object is of the boolean type, that is, this code does not seem to have any effect.
If (target. constructor = Boolean ){
Deep = target;
Target = arguments [1] || {};
}
// Extend jQuery itself if only one argument is passed
If (al = 1 ){
Target = this;
A = 0;
}
Var prop;
For (; a <al; a ++)
// Only deal with non-null/undefined values
If (prop = arguments [a])! = Null)
// Extend the base object
For (var I in prop ){
// Prevent never-ending loop
This piece of code does not know how to implement it. It is used to block the endless loop, but I don't know how it blocks it. It seems that it has no effect.
If (target = prop [I])
Continue;
// Recurse if we're merging object values
If (deep & typeof prop [I] = 'object' & target [I])
JQuery. extend (target [I], prop [I]);
// Don't bring in undefined values
Else if (prop [I]! = Undefined)
Target [I] = prop [I];
}
// Return the modified object
Return target;
};
How does jquery keep a function running?
Jquery is used more. Let's use native js.
Two methods
First
Function allRunFunction (){
//
}
SetInterval (allRunFuntion 1000 );
Second
Function allRunFunction (){
SetTimeout (allrunfunctions, 1000 );
}
Jquery defines a jquery Function
Change the Div ID to Class, use each to locate it, and bind it to Click.
$ (". Id"). each (fuction (){
Var idobj = $ (this );
Idobj. click (function (){
// Write your Click function here
});
});