Can XML be parsed reliably using jQuery's $(responseXML) syntax?

前端 未结 3 1935
有刺的猬
有刺的猬 2020-12-02 02:52

I\'m currently looking for an easy way to extract information from server XML responses using JavaScript. jQuery seems like a good candidate for this.

When it comes

3条回答
  •  天命终不由人
    2020-12-02 03:00

    Your link actually points to the usage of jQuery( html ) that deals with creation of elements from strings, i.e.

    $('')
    

    The one that your code uses is jQuery( element ) which is fine for XML.

    since responseXML is XML, not a string, you're free to use jQuery() on it.

提交回复
热议问题