:"Tom",age:21},{name:"Jerry",sex:"Boy"})
Then the merged result
result={name:"Jerry",age:21,sex:"Boy"}
That is to say, if the 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, {}, { nam
global object.Copy CodeThe code is as follows:$.extend ($.net,{hello:function () {alert (' Hello ');}})This is the extension of the Hello method into the net namespace of the previously extended jquery.Third, the Extend method of jquery also has an overloaded prototype:Copy CodeThe code is as follows: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 calle
1.$.extend$.extend (SRC)The method is to merge src into the global object of jquery.$.extend ({Hello:function () {alert (' Hello ');}});is to merge the Hello method into the global object of jquery.$.extend ($.net,{Hello:function () {alert (' Hello ');}})This is the extension of the Hello method into the net namespace of the previously extended jquery.2.extend (BOOLEAN,DEST,SRC1,SRC2,SRC3 ...)The first parameter, Boolean, indicates whether to make a deep copy, the rest of the parameters are cons
Copy codeThe Code is as follows:$. Ajax ({Type: "POST ",Url: "some. php ",Data: "name = John location = Boston", // The first method for passing Parameters// Data: {name: "John", location: "Boston"} // The second method for passing Parameters// Data: {foo: ["bar1", "bar2"]} to ' foo = bar1 foo = bar2'/*First, we use the url to pass parameters. If the parameter contains the "" symbol, the parameters may no
This article mainly summarizes the usage of the ajax Method data parameter in Jquery. If you need it, you can refer to it and hope to help you.
The Code is as follows:
$. Ajax ({Type: "POST ",Url: "some. php ",Data: "name = John location = Boston", // The first method for passing Parameters// Data: {name: "John", location: "Boston"} // The second method for passing Parameters// Data: {foo: ["bar1", "b
:{}}); $.extend ($.net,{ Hello:function() {alert (' Hello ')} )Or$.net = $.net | | {};$.extend ($.net,{ Hello:function() {alert (' hello ');} })This is the extension of the Hello method into jquery's net namespace. This is also the code that is written at the beginning of the jquery UI source.Three, heavy-duty prototypes1 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 desc
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 first deep copy parameter is true, then the re
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"},SRC2 also nested the object location:{state: "MA"}, the first deep copy parameter is tr
function postdata () { //submit data functions
$. Ajax ({ //calling Jquery's Ajax method
Type: "POST", //set the form of Ajax method submission data
Url: "ok.php", //submit data to ok.php
Data: "writer=" +$ ("#writer"). val (), //input box value in writer as submitted
Success: function (msg) { //post successful callback, msg variable is the content of ok.php Output.
Alert ("data submitted successfully"); //if necessary, The value of the MSG variable can be displayed in a DI
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:
[
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.