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