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 location:{city: "Boston"},src2 also nested the object location:{state: "MA"} , the first deep copy parameter is true, then t
'boolean' indicates whether to perform a deep copy. The other parameters are the same as described above. What is "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: " China " }}); We can see that the child Object Location: {City: "Boston"}
Pharmacology, cell biology, developmental and regenerative biology, genetics, and Biotechnology), in a multidisciplinary project with Harvard Arts and Sciences: Microbiology and molecular genetics, pathology, and other teachers from other departments, hospitals and research institutes), three programs from medical schools and university teachers: immunology, neuroscience and virology.(8) (Brigham and women ' s HOSPITAL,BWH) Brigham and Women's HospitalA famous hospital in Mission Mountain,
prototype:Extend (BOOLEAN,DEST,SRC1,SRC2,SRC3 ...)The first parameter, Boolean, indicates whether to make a deep copy, 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"}}, We can see that the nested SRC1 in the location:{city: "Boston
() {alert (' Hello ');}});is to merge the Hello method into the global object of jquery.2, $.fn.extend (SRC)This method merges src into the instance object of jquery, such as:$.fn.extend ({Hello:function () {alert (' Hello ');}});is to merge the Hello method into the instance object of jquery.The following examples illustrate several common extension instances:$.extend ({net:{}});This is the extension of a net namespace in the jquery global object.$.extend ($.net,{Hello:function () {alert (' He
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 location:{city: "Boston"},SRC2 also nested the object location:{state: "MA"} , the first deep copy parameter is true, then t
is. We are only interested in writing this framework and writing it for our own use and purpose, but we really didn't spend a lot of effort to let others use it. We never think of other frameworks as our competitors-because I have heard of such a thing on many occasions that we are fighting against browsers rather than each other. In my article, I suggest you try more options and then select a framework that suits your needs and your style. You really cannot make a bad choice (so please stop qu
described above. What is "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:"China"} } );
We can see that the child Object Location: {City: "Boston"} is embedded in src1, and the sub-Object Location: {state: "Ma"} is also nested in src2. The first parameter for deep copy
explanations. The mootools Team (I am one of them) has never really noticed how popular this framework is. We are only interested in writing this framework and writing it for our own use and purpose, but we really didn't spend a lot of effort to let others use it. We never think of other frameworks as our competitors-because I have heard of such a thing on many occasions that we are fighting against browsers rather than each other. In my article, I suggest you try more options and then select a
' indicates whether to perform a deep copy. The other parameters are the same as described above. What is "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:"China"} } );
We can see that the child Object location: {city: "Boston"} is embedded in src1, and the sub-Object lo
[prefix], traditional, add );}}
Now, I understand. If it is json data, we can concatenate strings using their name attribute and value Attribute in one loop.
For a common object, loop through the attributes of the object and splice the string.
Summary:
Therefore, in this article, three types of data can be imported into the ajax function of jquery.
1. Text: "uname = alice mobileept = 110 birthday ="
2. json object: {uanme: 'vic ', mobileIpt: '000000', birthday: '2017-11-11 '}
3. json array:
[
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: "
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.