Get Ajax return parameters

Source: Internet
Author: User

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

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.