How to use javascript to read XML files in firefox

Source: Internet
Author: User
Javascript in firefox reads XML files Javascript in firefox reads XML files
I searched for "javascript reading XML files in firefox" on the Internet for a long time. Many of them asked no answer. A bunch of programmers complained about firefox: "There is no benefit except exhausting programmers .", Let's get down to the truth. Firefox does not support ActiveXObject objects in ie. To obtain an xml dom, you can use either of the following methods:
1. document. implementation. createDocument ("", "", null );
2. window. XMLHttpRequest
Example: 1, Var dom = document. implementation. createDocument ("", "", null );
Dom. async = false;
Dom. load ("test. xml"); // dom is an xml object.
2, Var oXmlHttp = new XMLHttpRequest ();
OXmlHttp. open ("GET", "test. xml", false );
OXmlHttp. send (null );
// OXmlHttp. responseXML is an xml object.

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.