Reputation: 1391
I am invoking a web service through $.ajax(). onsuccess I am getting an xml document, now the problem is I need to see the contents of the retrieved xmlDocument..
Is there anyway to do that.. ??
Upvotes: 1
Views: 2277
Reputation: 10604
Put it to the textarea field as-is
$("#textareaID").val(xmlstr);
or display with html-encoding:
$("#someDivID").text(xmlstr); // jQuery text() function performs html-encoding automatically
Simple demo: http://jsfiddle.net/wKhnF/1/
Note dataType: "text"
, it is required to process the response contents as a text rather then XML object.
Upvotes: 2
Reputation: 52799
Use Firebug to check the response.
You can use http://api.jquery.com/jQuery.parseXML/ to read, parse the XML, find, and retrieve elements.
$.parseXML(xml)
Upvotes: 1