Moves determineDataType into ajaxSettings so that it is accessible to transports without the need for a second argument and so that we can now pass the original options to the transport instead. Also ensures the original options are actually propagated to prefilters (they were not).
This commit is contained in:
parent
3ea366401f
commit
1cecfa1ece
2 changed files with 52 additions and 51 deletions
|
@ -53,7 +53,7 @@ testXHR = undefined;
|
|||
|
||||
// Create transport if the browser can provide an xhr
|
||||
if ( jQuery.support.ajax ) {
|
||||
jQuery.ajaxTransport( function( s , determineDataType ) {
|
||||
jQuery.ajaxTransport( function( s ) {
|
||||
|
||||
// Cross domain only allowed if supported through XMLHttpRequest
|
||||
if ( ! s.crossDomain || jQuery.support.cors ) {
|
||||
|
@ -186,8 +186,7 @@ if ( jQuery.support.ajax ) {
|
|||
|
||||
// Guess response & update dataType accordingly
|
||||
response =
|
||||
determineDataType(
|
||||
s,
|
||||
s.determineDataType(
|
||||
xhr.getResponseHeader("content-type"),
|
||||
xhr.responseText,
|
||||
xhr.responseXML );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue