jQuery 1.0.2

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

        if ( data ) url += ((url.indexOf("?") > -1) ? "&" : "?") + jQuery.param(data);

        // Build and start the HTTP Request
        jQuery.ajax( "GET", url, null, function(r, status) {
            if ( callback ) callback( jQuery.httpData(r,type), status );
        }, ifModified);
    },
    getIfModified: function( url, data, callback, type ) {
        jQuery.get(url, data, callback, type, 1);
    },
    getScript: function( url, callback ) {
        jQuery.get(url, callback, "script");
    },
    getJSON: function( url, data, callback ) {
        if(callback)
            jQuery.get(url, data, callback, "json");
        else {
            jQuery.get(url, data, "json");
        }
    },
    post: function( url, data, callback, type ) {
        // Build and start the HTTP Request
        jQuery.ajax( "POST", url, jQuery.param(data), function(r, status) {
            if ( callback ) callback( jQuery.httpData(r,type), status );
        });
    },

    // timeout (ms)
    timeout: 0,
    ajaxTimeout: function(timeout) {
        jQuery.timeout = timeout;
    },

    // Last-Modified header cache for next request
    lastModified: {},
    ajax: function( type, url, data, ret, ifModified ) {
        // If only a single argument was passed in,