jQuery 1.0.2

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

     * otherwise return plain text.
     * (String) data - The type of data that you're expecting back,
     * (e.g. "xml", "html", "script")
     */
    httpData: function(r,type) {
        var ct = r.getResponseHeader("content-type");
        var data = !type && ct && ct.indexOf("xml") >= 0;
        data = type == "xml" || data ? r.responseXML : r.responseText;

        // If the type is "script", eval it
        if ( type == "script" ) eval.call( window, data );

        // Get the JavaScript object, if JSON is used.
        if ( type == "json" ) eval( "data = " + data );

        return data;
    },

    // Serialize an array of form elements or a set of
    // key/values into a query string
    param: function(a) {
        var s = [];

        // If an array was passed in, assume that it is an array
        // of form elements
        if ( a.constructor == Array || a.jquery ) {
            // Serialize the form elements
            for ( var i = 0; i < a.length; i++ )
                s.push( a[i].name + "=" + encodeURIComponent( a[i].value ) );

        // Otherwise, assume that it's an object of key/value pairs
        } else {
            // Serialize the key/values