jQuery 1.0.2

2020-05-23 06:10:44易采站长站整理

        if ( data )
            xml.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”);
        // Set the If-Modified-Since header, if ifModified mode.
        if ( ifModified )
            xml.setRequestHeader(“If-Modified-Since”,
                jQuery.lastModified[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”);
        // 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” ?
                    ifModified && jQuery.httpNotModified( xml, url ) ? “notmodified” : “success” : “error”;
                // Make sure that the request was successful or notmodified