Skip to content
Permalink
Browse files

jquery ajax: passing the settings object to httpData instead of just …

…the dataFilter, so that when called it retains the object as "this".
  • Loading branch information
flesler committed Jun 5, 2008
1 parent 24eb176 commit c90fe0283bac94327a8a8ec75e7292322c77dd01
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/ajax.js
@@ -336,7 +336,7 @@ jQuery.extend({
// Watch for, and catch, XML document parse errors
try {
// 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) {
status = "parsererror";
}
@@ -460,7 +460,7 @@ jQuery.extend({
return false;
},

httpData: function( xhr, type, filter ) {
httpData: function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
@@ -469,8 +469,8 @@ jQuery.extend({
throw "parsererror";

// Allow a pre-filtering function to sanitize the response
if( filter )
data = filter( data, type );
if( s.dataFilter )
data = s.dataFilter( data, type );

// If the type is "script", eval it in global context
if ( type == "script" )

0 comments on commit c90fe02

Please sign in to comment.
You can’t perform that action at this time.