| 634 | | var status; |
| 635 | | try { |
| 636 | | status = isTimeout == "timeout" && "timeout" || |
| 637 | | !jQuery.httpSuccess( xml ) && "error" || |
| 638 | | s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" || |
| 639 | | "success"; |
| 640 | | |
| 641 | | // Make sure that the request was successful or notmodified |
| 642 | | if ( status != "error" && status != "timeout" ) { |
| 643 | | // Cache Last-Modified header, if ifModified mode. |
| 644 | | var modRes; |
| 645 | | try { |
| 646 | | modRes = xml.getResponseHeader("Last-Modified"); |
| 647 | | } catch(e) {} // swallow exception thrown by FF if header is not available |
| 648 | | |
| 649 | | if ( s.ifModified && modRes ) |
| 650 | | jQuery.lastModified[s.url] = modRes; |
| 651 | | |
| | 634 | var status = isTimeout == "timeout" && "timeout" || |
| | 635 | !jQuery.httpSuccess( xml ) && "error" || |
| | 636 | s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" || |
| | 637 | "success"; |
| | 638 | |
| | 639 | if ( status == "success" ) { |
| | 640 | // Watch for, and catch, XML document parse errors |
| | 641 | try { |
| 659 | | // Fire the global callback |
| 660 | | if( s.global ) |
| 661 | | jQuery.event.trigger( "ajaxSuccess", [xml, s] ); |
| 662 | | } else |
| 663 | | jQuery.handleError(s, xml, status); |
| 664 | | } catch(e) { |
| 665 | | status = "parsererror"; |
| 666 | | jQuery.handleError(s, xml, status, e); |
| 667 | | } |
| | 660 | // If a local callback was specified, fire it and pass it the data |
| | 661 | if ( s.success ) |
| | 662 | s.success( data, status ); |
| | 663 | |
| | 664 | // Fire the global callback |
| | 665 | if( s.global ) |
| | 666 | jQuery.event.trigger( "ajaxSuccess", [xml, s] ); |
| | 667 | } else |
| | 668 | jQuery.handleError(s, xml, status); |