1the Ajax function, p1 for normal function execwebfunction (CALLBACK,P1) {$.ajax ({type:"POST", ContentType:"Application/json; Charset=utf-8", datatype:"JSON", Url:url, Data:ajaxdata, Beforesend:function (XMLHttpRequest) {
//specifying this header ensures that the results would be is returned as JSON.Xmlhttprequest.setrequestheader ("Accept","Application/json"); }, Success:function (data, Textstatus, XMLHttpRequest) {//EXECUTE statement successfully if(typeofcallback = = ='function') {Callback ("SUCCESS", DATA.D); } getresult (DATA.D); }, Error:function (XMLHttpRequest, Textstatus, Errorthrown) {//Error Execution Statement if(typeofcallback = = ='function') {Callback ("ERROR", Textstatus); } } }); }2callback Function--used to handle the transaction after execution of the above. function callback (info, result) {if(Info = ="SUCCESS") { //Do somethings } Else { //Do somethings } }3The method is called as follows: Execwebfunction (CALLBACK,P1);
Get Ajax return parameters