Ticket #4964: jquery4964.patch
File jquery4964.patch, 1.0 KB (added by , 13 years ago) |
---|
-
src/ajax.js
400 400 "notmodified" : 401 401 "success"; 402 402 403 // allow request interception before success/error/status callback 404 if ( s.ready ) { 405 s.ready( xhr, status ); 406 } 407 403 408 if ( status === "success" ) { 404 409 // Watch for, and catch, XML document parse errors 405 410 try { … … 462 467 } 463 468 464 469 function success(){ 470 var handler = s[xhr.status] || s.success; 465 471 // If a local callback was specified, fire it and pass it the data 466 if ( s.success) {467 s.success( data, status );472 if ( handler ) { 473 handler( data, status ); 468 474 } 469 475 470 476 // Fire the global callback … … 495 501 }, 496 502 497 503 handleError: function( s, xhr, status, e ) { 504 var handler = s[xhr.status] || s.error; 498 505 // If a local callback was specified, fire it 499 if ( s.error ) {500 s.error( xhr, status, e );506 if ( handler ) { 507 handler( xhr, status, e ); 501 508 } 502 509 503 510 // Fire the global callback