jQuery 1.0.2

2019-06-03 18:50:05于海丽

        // assume that it is a object of key/value pairs
        if ( !url ) {
            ret = type.complete;
            var success = type.success;
            var error = type.error;
            var dataType = type.dataType;
            var global = typeof type.global == "boolean" ? type.global : true;
            var timeout = typeof type.timeout == "number" ? type.timeout : jQuery.timeout;
            var ifModified = type.ifModified || false;
            data = type.data;
            url = type.url;
            type = type.type;
        }

        // Watch for a new set of requests
        if ( global && ! jQuery.active++ )
            jQuery.event.trigger( "ajaxStart" );

        var requestDone = false;

        // Create the request object
        var xml = new XMLHttpRequest();

        // Open the socket
        xml.open(type || "GET", url, true);

        // Set the correct header, if data is being sent
        if ( data )
            xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        // Set the If-Modified-Since header, if ifModified mode.
        if ( ifModified )