xhr.onload = function() { // Give me a xml document. var doc = this.responseXML.documentElement;
// Get the token element, then the first item (could be lots of them) then the text of the first. var token = doc.getElementsByTagName("token").item(0).text;
// Ditto as above, but this time get the attribute name "username" var username = doc.getElementsByTagName("user").item(0).getAttribute("username"); }
No comments:
Post a Comment