20151211jquery Ajax Advanced Code Backup

Source: Internet
Author: User

Data processing $ (' form Input[type=button] '). Click (function () {//json handles/*$.ajax ({type: ' POST ', url: ' Test.json ', DataType: ' JSON ', data:$ (' form '). Serialize (), Success:function (RESPONSE,STATUS,XHR) {alert (Response[0].url);}}); *///Local get jsonp.php success/*$.ajax ({type: ' POST ', url: ' jsonp.php ', DataType: ' JSON ', Success:function (RESPONSE,STATUS,XHR) {alert (RESPONSE.A);}}); *///cross-domain get jsonp.php, failed/*$.ajax ({type: ' POST ', url: ' http://www.li.cc/jsonp.php ', DataType: ' JSON ', success:function ( RESPONSE,STATUS,XHR) {alert (RESPONSE.A);}}); *///Local get jsonp2.php success/*$.getjson (' jsonp2.php?callback=? ', function (response) {alert (RESPONSE.A);}); *///cross-domain, remote, successful/*$.getjson (' http://www.li.cc/jsonp2.php?callback=? ', function (response) {alert (RESPONSE.A);}); *//*$.ajax ({type: ' POST ', url: ' jsonp2.php ', DataType: ' Jsonp ', success:function (RESPONSE,STATUS,XHR) {alert ( RESPONSE.A);}); The *///jqxhr object//JQXHR is the object returned by $.ajax/*var Jqxhr=$.ajax ({type: ' POST ', url: ' user.php ', data:$ (' form '). Serialize ()}); */// alert (JQXHR);/*jqxhr.success (function (response) {alert (response);}); *//*jqxhr.done (function (response) {alert (response+ ' 1 ');}). Done (function (response) {alert (response+ ' 2 ');}); /Can concatenating operation Jqxhr.done (function (response) {alert (response+ ' 3 ');}); */var jqxhr=$.ajax (' t1.php '); var jqxhr2=$.ajax (' t2.php ');/*jqxhr.done (function (response) {alert (response);}); Jqxhr2.done (function (response) {alert (response);});    */$.when (JQXHR,JQXHR2). Done (function (R1,R2) {alert (r1[0]); alert (r2[0]);}); });

  

20151211jquery Ajax Advanced Code Backup

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.