Read XML file using JavaScript in Chrome

前端 未结 4 1223
栀梦
栀梦 2021-01-02 18:03

I need to load and read an XML file using JavaScript.

The following code works fine in Firefox, IE and Opera:

         


        
4条回答
  •  粉色の甜心
    2021-01-02 18:26

    On MDN, there is guidance to use XMLHttpRequest. But it isn't clear from DOMImplementation.createDocument until you drill into the return type and see that XMLDocument is not supported in Google Chrome. The example on W3Schools uses XMLHttpRequest.

提交回复
热议问题