I’m trying to retrieve some XML from the Gmail API. I have this so far:
$.ajax({
url: "https://mail.google.com/mail/feed/atom/",
success: function(data) {
console.log(data.responseText);
}
});
I know for sure that the array data has a value called responseText because the console tells me so when I get my code to log data. However, when I try to log data.responseText, it logs data and ignores the fact that I specified a parameter (it doesn’t say that responseText is not defined). What am I doing wrong?
Edit: here is a screenshot of what the console says data is:

Edit, in response to Kevin: I tried this:
$.ajax({
url: "https://mail.google.com/mail/feed/atom/",
dataType: "xml",
success: function(data) {
console.log($("feed fullcount",data).html());
}
});
it says that it “Cannot call method ‘replace’ of undefined” 😮
datais not an xhr object, it is your xml string converted into anXML Document. Therefore, it doesn’t have aresponseTextproperty unless the xml doc has a responseText node. Also, adddataType: "xml"to your ajax options if you are expecting xml.Edit: Now i see in your question (after edit) that it is infact an xhr object… That’s odd…