Ticket #2567: ajax-filter.diff
File ajax-filter.diff, 1.1 KB (added by , 14 years ago) |
---|
-
ajax.js
330 330 // Watch for, and catch, XML document parse errors 331 331 try { 332 332 // process the data (runs the xml through httpData regardless of callback) 333 data = jQuery.httpData( xml, s.dataType );333 data = jQuery.httpData( xml, s.dataType, s.dataFilter ); 334 334 } catch(e) { 335 335 status = "parsererror"; 336 336 } … … 454 454 return false; 455 455 }, 456 456 457 httpData: function( r, type ) {457 httpData: function( r, type, filter ) { 458 458 var ct = r.getResponseHeader("content-type"), 459 459 xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, 460 460 data = xml ? r.responseXML : r.responseText; … … 462 462 if ( xml && data.documentElement.tagName == "parsererror" ) 463 463 throw "parsererror"; 464 464 465 // Allow a pre-filtering function to sanitize the response 466 if( filter ) 467 data = filter( data, type ); 468 465 469 // If the type is "script", eval it in global context 466 470 if ( type == "script" ) 467 471 jQuery.globalEval( data );