Skip to content

Instantly share code, notes, and snippets.

@vjeux
Created October 25, 2011 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjeux/1314520 to your computer and use it in GitHub Desktop.
Save vjeux/1314520 to your computer and use it in GitHub Desktop.
// Change
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
responses.text = xhr.responseText;
// By
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
if (s.responseHandler && s.responseHandler[ s.dataType ]) {
s.responseHandler[ s.dataType ](responses, s, xhr);
}
else {
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
responses.text = xhr.responseText;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment