jQuery 1.0.4 - New Wave Javascript(js源文件)

2019-06-03 09:49:42刘景俊

        if ( s.ifModified )
            xml.setRequestHeader("If-Modified-Since",
                jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );

        // Set header so the called script knows that it's an XMLHttpRequest
        xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");

        // Make sure the browser sends the right content length
        if ( xml.overrideMimeType )
            xml.setRequestHeader("Connection", "close");

        // Allow custom headers/mimetypes
        if( s.beforeSend )
            s.beforeSend(xml);
        if (s.global)
            jQuery.event.trigger("ajaxSend", [xml, s]);

        // Wait for a response to come back
        var onreadystatechange = function(isTimeout){
            // The transfer is complete and the data is available, or the request timed out
            if ( xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
                requestDone = true;

                var status = jQuery.httpSuccess( xml ) && isTimeout != "timeout" ?
                    s.ifModified && jQuery.httpNotModified( xml, s.url ) ? "notmodified" : "success" : "error";

                // Make sure that the request was successful or notmodified
                if ( status != "error" ) {