JavaScript uses Microsoft. XMLDOM to read remote XML file content

Source: Internet
Author: User

Why does JS use Microsoft. XMLDOM to read remote XML files? As a matter of fact, we can see from an example that we have recently created an ajax page to remotely read weather information. Weather Information is the content of a remote website and is stored in XML files, therefore, to implement AJAX, We need to read the XML file in JS. In the beginning, it is difficult. In fact, we do not think so.

In the above Code, http: // *****. com/ajax/weather. asp? Subcode = b55 is the weather XML Information of a remote website. xml generated by ASP is used. The XMLDOM component is called to read the data directly, and the selectSingleNode method is called to read the content of the last node, that's it, right?

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.