Moves determineResponse logic into main ajax callback. Puts responseXXX fields definitions into ajaxSettings.
This commit is contained in:
parent
8ad2b31ff6
commit
3dbd600e19
2 changed files with 79 additions and 84 deletions
|
@ -149,6 +149,12 @@ if ( jQuery.support.ajax ) {
|
|||
responses = {},
|
||||
xml = xhr.responseXML;
|
||||
|
||||
// Construct response list
|
||||
if ( xml && xml.documentElement /* #4958 */ ) {
|
||||
responses.xml = xml;
|
||||
}
|
||||
responses.text = xhr.responseText;
|
||||
|
||||
try { // Firefox throws an exception when accessing statusText for faulty cross-domain requests
|
||||
|
||||
statusText = xhr.statusText;
|
||||
|
@ -184,15 +190,8 @@ if ( jQuery.support.ajax ) {
|
|||
status
|
||||
);
|
||||
|
||||
// Construct response list
|
||||
if ( xml && xml.documentElement /* #4958 */ ) {
|
||||
responses.xml = xml;
|
||||
}
|
||||
responses.text = xhr.responseText;
|
||||
|
||||
// Call complete
|
||||
complete(status,statusText,s.determineResponse( responses,
|
||||
xhr.getResponseHeader( "content-type" ) ),responseHeaders);
|
||||
complete(status,statusText,responses,responseHeaders);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue