JavaScript reads remote XML file content using Microsoft.XMLDOM

Source: Internet
Author: User

JS uses Microsoft.XMLDOM to read the contents of the remote XML file, why do you want to read it remotely? In fact, for example, it is understood, because recently to engage in a remote reading of the weather information of the AJAX page, the weather information is the content of the remote Web site, is in the form of XML files, So we want to implement Ajax, we need to read the XML file in JS, began to feel very difficult ah, in fact, do not think so.

In the above code, HTTP://****.COM/AJAX/WEATHER.ASP?SUBCODE=B55 is the weather XML information of the remote Web site, XML generated by ASP, which directly calls the XMLDOM component for reading, And then call the selectSingleNode method, read the contents of the last node, that's it, is it simple?

Related Article

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.