jquery ajax: passing the settings object to httpData instead of just the dataFilter, so that when called it retains the object as "this".
This commit is contained in:
parent
24eb176f0c
commit
c90fe0283b
1 changed files with 4 additions and 4 deletions
|
@ -336,7 +336,7 @@ jQuery.extend({
|
||||||
// Watch for, and catch, XML document parse errors
|
// Watch for, and catch, XML document parse errors
|
||||||
try {
|
try {
|
||||||
// process the data (runs the xml through httpData regardless of callback)
|
// process the data (runs the xml through httpData regardless of callback)
|
||||||
data = jQuery.httpData( xhr, s.dataType, s.dataFilter );
|
data = jQuery.httpData( xhr, s.dataType, s );
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
status = "parsererror";
|
status = "parsererror";
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ jQuery.extend({
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
httpData: function( xhr, type, filter ) {
|
httpData: function( xhr, type, s ) {
|
||||||
var ct = xhr.getResponseHeader("content-type"),
|
var ct = xhr.getResponseHeader("content-type"),
|
||||||
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
|
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
|
||||||
data = xml ? xhr.responseXML : xhr.responseText;
|
data = xml ? xhr.responseXML : xhr.responseText;
|
||||||
|
@ -469,8 +469,8 @@ jQuery.extend({
|
||||||
throw "parsererror";
|
throw "parsererror";
|
||||||
|
|
||||||
// Allow a pre-filtering function to sanitize the response
|
// Allow a pre-filtering function to sanitize the response
|
||||||
if( filter )
|
if( s.dataFilter )
|
||||||
data = filter( data, type );
|
data = s.dataFilter( data, type );
|
||||||
|
|
||||||
// If the type is "script", eval it in global context
|
// If the type is "script", eval it in global context
|
||||||
if ( type == "script" )
|
if ( type == "script" )
|
||||||
|
|
Loading…
Add table
Reference in a new issue