after the method is merged. If you want to get the merged result but do not want to modify the dest structure, you can use the following:2. var newSrc = $. extend ({}, src1, src2, src3...) // "{}" is used as the dest parameter.
In this way, you can merge src1, src2, src3... and return the merged result to newSrc.
For example:
1
Var result = $. extend ({}, {name: "Tom", age: 21 },{ name: "Jerry", sex: "Boy "})
Then the merged result
1
Re
following parameter has the same name as the preceding parameter, the following parameter will overwrite the preceding parameter value.3. extend (boolean, dest, src1, src2, src3 ...)
The first parameter boolean indicates whether to perform a deep copy. The other parameters are consistent with the previous descriptions.For example:
var result=$.extend( true, {}, { name: "John", location: {city: "Boston",county:"USA"} }, { last: "Resig", location: {sta
The data sent to the server. Will be automatically converted to the request string format. The GET request will be appended to the URL. View the description of the processdata option to disable automatic conversion. It must be in key/value format. If it is an array, jquery automatically corresponds to the same name for different values. For example, {FOO: ["bar1", "bar2"]} is converted to ' Foo = bar1 Foo = bar2 '.
Example:
$. Ajax ({type: "Post", URL: "Some. PHP ", data:" name = John loca
Let's get to the general query Ajax parameters
Data sent to the server. is automatically converted to the request string format. The GET request is appended to the URL. View the ProcessData option description to prevent this automatic conversion. Must be in the Key/value format. If you are an array, JQuery will automatically correspond to the same name for different values. such as {foo:["bar1", "Bar2"]} is converted to ' foo=bar1foo=bar2 '.
Example:
The code is as follows
Cop
parameters are consistent with what was described earlier, what is called deep copy, and we look at an example:var Result=$.extend (True, {}, {name: "John", Location: {City: "Boston", County: "USA"}}, {last: "Resig", Loca tion: {state: "MA", County: ' China '}});We can see that the nested SRC1 in the location:{city: "Boston"},SRC2 also nested the object location:{state: "MA"}, the first deep copy parameter
Donnie Yen was born in Guangdong, 2 years old to Hong Kong until the 11-year-old immigrants to Boston, United States. Mother Mabao is a world-famous martial arts and Taijiquan, in the local founder of the Chinese Wushu Research Association. Donnie Yen with mother to learn martial, but began to learn piano, will play Chopin March, music is his life inspiration one of the sources. Father Hing Yunlong, editor of the
$.extend (Hello:function () {alert (' Hello ');})
is to merge the Hello method into the global object of jquery.The following examples illustrate several common extension instances:[JavaScript]View PlainCopy
$.extend ({net:{}})
This is the extension of a net namespace in the jquery global object.[JavaScript]View PlainCopy
$.extend ($.net,{
Hello:function () {alert (' Hello ');}
})
This is the extension of the Hello method into the net namespac
merge the Hello method into the instance object of jquery.
The following example illustrates several common extension instances:
$.extend ({net:{}});
This is the extension of a net namespace in the jquery global object.
$.extend ($.net,{
Hello:function () {alert (
'Hello');}})
This is to extend the Hello method to the net namespace of the previously extended jquery.
Three, jquery extend method also has an
,SRC3 ...) nbsp; The first parameter Boolean represents whether to make a deep copy, and the remaining parameters are consistent with the previous description nbsp; For example nbsp; code as follows: Var result=$.extend (True, {},nbsp; {name: "John", Loca tion: {City: "Boston", County: "The USA"}},nbsp; {last: "Resig", Location: {state: "MA", County: ""});nbsp; nbsp; we can To see that the nested SRC1 in the location:{city: "
of the arguments are consistent with the previous description, and what is called a deep copy, let's look at an example:
var Result=$.extend (True, {},
{Name: "John", Location: {City: "Boston", County: "USA"}},
{Last: "Resig", Location: {state: "MA", County: "" "});
We can see that the nested SRC1 in the location:{city: "Boston"},SRC2 also have nested objects location:{state: "MA"}, the first depth cop
same name as the previous argument, then the previous parameter value will be overwritten.3, Extend (BOOLEAN,DEST,SRC1,SRC2,SRC3 ...)
The first argument Boolean represents whether to make a deep copy, and the rest of the parameters are consistent with the previousFor example:
var Result=$.extend (True, {},
{name: "John", Location: {City: "Boston", County: "USA"}},
{last: "Resig", Locatio N: {state: "MA", County: "" "});
We can see t
jquery.
The following example illustrates several common extension instances:
$.extend ({net:{}});
This is the extension of a net namespace in the jquery global object.
Copy Code code as follows:
$.extend ($.net,{hello:function () {alert (' Hello ');} })
This is to extend the Hello method to the net namespace of the previously extended jquery.
Three, jquery extend method also has an overloaded prototype:
Extend (BOOLEAN,DEST,SRC1,SRC2,SRC3 ...)
The first argument Bo
=johnlocation=boston",
Success:function (msg) {
Alert ("Data Saved:" + msg);
}
});
The parameters behind this data can be used in two types of tables: One is the normal URL argument, and one is written in the JSON array,The above example data section can also be written like this: data: {name: "John", Location: "Boston"}. What is the difference between these two usages?
The nuances of usag
the" Return key. It'll create a new paragraph only if I begin the tag with another one.
Here ' s the next paragraph.
Error Demo: (Post Office can not accept a row of addresses) source code 566 E Boston Post RDMamaroneck NY 10543-9982United States of AmericaResults 566 E Boston Post RD mamaroneck NY 10543-9982 United States of America
Correct example:Original code566 E
, the rest of the parameters are consistent with what was described earlier, what is called deep copy, and we look at an example:
var result = $.extend (true, {}, {name: "John", Location: {City: "Boston", County: ' USA '}}, {last: "Resig", Location: {state: ' MA ', County: ' China '}};
We can see that the nested SRC1 in the location:{city: "Boston"},SRC2 also nested the object location:{state: "MA"}, the fi
EXTENSION oracle_fdw;CREATE SERVER oradb FOREIGN DATA WRAPPER oracle_fdw
OPTIONS (dbserver ‘oratest‘);GRANTUSAGEONFOREIGN SERVER oradb TO scott; Note that "Oratest" in the above command "DBServer ' Oratest" is the tnsnames set in the preceding TNSNames. The above SQL assigns access to the Oracle external service to the user Scott, who is now logged on with the Scott User: CREATEUSER MAPPING FORcurrent_user SERVER oradb
OPTIONS (user‘scott‘, password ‘tiger‘);CREATEFOREIGNTAB
similar to the merging of arrays of operations.But here is the object. To illustrate:[JavaScript]View PlainCopy
Usage: jquery.extend (obj1,obj2,obj3,..)
var css1={size: "10px", Style: "Oblique"}
var css2={size: "12px", Style: "oblique", Weight: "bolder"}
$.jquery.extend (CSS1,CSS2)
Result: The Size property of the Css1 is overwritten, and the weight property of the Css2 is inherited
Css1 = {size: "12px", Style: "Oblique", Weight: "Bolder"}
2. Deep nested ob
extension instances:
$.extend ({net:{}});
This is the extension of a net namespace in the jquery global object.
$.extend ($.net,{hello:function () {alert (' Hello ');}})
This is to extend the Hello method to the net namespace of the previously extended jquery.
3 Deep Copy
The former. Extend ()
Jquery.extend (False,
{Name: "John", Location: {City: "Boston"}},
{Last: ' Resig ', location: {state: ' MA '}}
);
Results:
=> {name: ' John ', Last: ' Resig ',
* FROM dept; DEPTNO dname LOC---------- -------------- -------------Ten ACCOUNTING NEW YORKDALLASSALES CHICAGOOPERATIONS BOSTON sql> Col deptno format 9999;Sql> select * FROM dept; DEPTNO dname LOC------ -------------- -------------Ten ACCOUNTING NEW YORKDALLASSALES CHICAGOOPERATIONS BOSTON Sets the width of the varchar2 type column here A30 represents a width of 30 characters. sql> Col dname format A30;S
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.