Ajax implementation Asynchronous Operation instance _ request data for XML format

Source: Internet
Author: User

JS Classification has a section "Native JS asynchronous request, XML parsing" mainly explains how JS foreground processing XML format request and how to accept the XML data returned by the server parsing, today I will use an example to illustrate how to do.

The parameter type of the foreground is also XML using jquery:

    function test () {    var xmlstring = "<bookstore>" +                    "<book type= ' compulsory course ' isbn= ' 7-111-19149-2 ' >" +                    " <title> Data Structures </title> "+                    " <author> Min </author> "+                    " <price>30.00</price > "+                    " </book></bookstore> ";    $.ajax ({type: "post", url: "Hand/ajax.ashx", Data: "Strxml=" +xmlstring,datatype: "xml", Success:function (XML) {// Update the page alert ("Success") according to Resulttext, alert ($ (XML). Find (' Table1 '). Find (' title '). Text ());},error:function ( Xmlresponse) {alert (Xmlresponse.responsetext)}});}

The foreground is in the XML format parameters, how to do in the background? This is for XML read-write, here is a simple explanation:

XmlDocument Xdoc = new XmlDocument (); Xdoc. LOADXML (strxml);//Read XML string Strxmlxdoc. Load (filename);//Read XML file filename is the path to the file

  

Ajax implementation Asynchronous Operation instance _ request data for XML format

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.