MCPcopy Index your code
hub / github.com/JsAaron/jQuery / done

Function done

2.1.1/src/ajax.js:656–765  ·  view source on GitHub ↗
( status, nativeStatusText, responses, headers )

Source from the content-addressed store, hash-verified

654
655 // Callback for when everything is done
656 function done( status, nativeStatusText, responses, headers ) {
657 var isSuccess, success, error, response, modified,
658 statusText = nativeStatusText;
659
660 // Called once
661 if ( state === 2 ) {
662 return;
663 }
664
665 // State is "done" now
666 state = 2;
667
668 // Clear timeout if it exists
669 if ( timeoutTimer ) {
670 clearTimeout( timeoutTimer );
671 }
672
673 // Dereference transport for early garbage collection
674 // (no matter how long the jqXHR object will be used)
675 transport = undefined;
676
677 // Cache response headers
678 responseHeadersString = headers || "";
679
680 // Set readyState
681 jqXHR.readyState = status > 0 ? 4 : 0;
682
683 // Determine if successful
684 isSuccess = status >= 200 && status < 300 || status === 304;
685
686 // Get response data
687 if ( responses ) {
688 response = ajaxHandleResponses( s, jqXHR, responses );
689 }
690
691 // Convert no matter what (that way responseXXX fields are always set)
692 response = ajaxConvert( s, response, jqXHR, isSuccess );
693
694 // If successful, handle type chaining
695 if ( isSuccess ) {
696
697 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
698 if ( s.ifModified ) {
699 modified = jqXHR.getResponseHeader("Last-Modified");
700 if ( modified ) {
701 jQuery.lastModified[ cacheURL ] = modified;
702 }
703 modified = jqXHR.getResponseHeader("etag");
704 if ( modified ) {
705 jQuery.etag[ cacheURL ] = modified;
706 }
707 }
708
709 // if no content
710 if ( status === 204 || s.type === "HEAD" ) {
711 statusText = "nocontent";
712
713 // if not modified

Callers 1

ajax.jsFile · 0.70

Calls 2

ajaxHandleResponsesFunction · 0.70
ajaxConvertFunction · 0.70

Tested by

no test coverage detected