$ (function () {/*$ (' form Input[type=button] '). Click (function () {$.ajax ({type: ' POST ',//url: ' http://www.google.com/u ser.php ', url: ' user1.php ', data:$ (' form '). Serialize (), Success:function (RESPONSE,STATUS,XHR) {$ ("#box"). HTML ( Response);},error:function (Xhr,errortext,errortype) {//alert (' ERROR!! //alert (errortext+ ': ' +errortype); alert (xhr.status+ ': ' +xhr.statustext);} Timeout:3000//global:false}); }); $ (document). Ajaxstart (function () {$ ('. Loading '). Show (); }). Ajaxstop (function () {$ ('. Loading '). Hide (); $.post (' user1.php '). Error (function (xhr,errortext,errortype) {// Alert (' Error ');//alert (errortext+ ': ' +errortype); alert (xhr.status+ ': ' +xhr.statustext);}) $.post (' user1.php '); }); $ (document). Ajaxerror (function (event, JQXHR, Ajaxoptions, thrownerror) {//alert (' Error ');//alert (event.type);//ale RT (Event.target);/*for (var i in event) {document.write (i+ ' <br/> ');} *//*for (var i in ajaxoptions) {document.write (i+ ' <br/> ');} alert (Ajaxoptions.url);//alert (ajaxoptions.type); alert (thrownerror); }); $ (document). Ajaxstart (function () {$ ('. Loading '). Show (); }); */$ (' form Input[type=button] '). Click (function () {$.post (' user1.php ', $ (' form '). Serialize ()). Success (function () {alert (' After the request succeeds ');}). Complete (function () {alert (' After the request is completed ');}). Error (function () {alert (' after request failed ');}); });/*$ (document). Ajaxsend (function (event, JQXHR, ajaxoptions) {alert (' Execute before sending request '); }). Ajaxcomplete (function (event, XMLHttpRequest, ajaxoptions) {alert (' execute ' after the request is completed, whether or not an error occurs); }). ajaxsuccess (function (event, XMLHttpRequest, ajaxoptions) {alert (' after successful request '); }). Ajaxerror (function (event, JQXHR, Ajaxoptions, thrownerror) {alert (' after request failed '); });*/});
20151210jquery Advanced Code Backup