How do I get the entire XML string from a XMLDocument returned by jQuery (cross browser)?

If you want both, get the response as XML Document and as string. You should be able to do

success: function(data){
  //data.xml check for IE
  var xmlstr = data.xml ? data.xml : (new XMLSerializer()).serializeToString(data);
  alert(xmlstr);
}

If you want it as string why do you specify dataType:xml wouldn’t then dataType:text be more appropriate?

Leave a Comment

tech