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


I'm currently exploring an easy way to extract information from server XML responses using Javascript. JQuery seems like a good candidate for this.

When it comes to parsing the XML with jQuery, I am coming in the same code examples as the following snippet:

  function parseXml However, jQuery The main document (quoted below) clearly states that you do not want to:   

jQuery (html, [ownerDocument])

html A string of HTML to fly that note that it purses HTML, No XML.

& mdash;

This makes me wonder that due to so many online resources, it is recommended to parse XML via $ (responseXml) . Does it usually work without any problem despite the ADI documentation? In what cases will the XML actually parsing not in such a way?

the jQuery Ajax documentation says:

Datatype

"xml": Returns an XML document that can be processed through jQuery.

... If the server reports return data in the form of XML, the result may be by using normal XML methods or jQuery selectors ...

< P> Apart from this

When XML data is returned from an Ajax call, we can wrap it using the $ () function in a jQuery object which we can easily work with . Once this is done, we can retrieve the individual elements of the XML structure using the .find () and other DOM translal methods.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -