jQuery 1.0.4 New Wave Javascript(js源文件)

2020-05-19 07:32:46易采站长站整理

        // Otherwise, assume that it’s an object of key/value pairs
        } else {
            // Serialize the key/values
            for ( var j in a ) {
                // If the value is an array then the key names need to be repeated
                if( a[j].constructor == Array ) {
                    for (var k = 0; k < a[j].length; k++) {
                        s.push( j + “=” + encodeURIComponent( a[j][k] ) );
                    }
                } else {
                    s.push( j + “=” + encodeURIComponent( a[j] ) );
                }
            }
        }
        // Return the resulting serialization
        return s.join(“&”);
    },
    // evalulates a script in global context
    // not reliable for safari
    globalEval: function(data) {
        if (window.execScript)
            window.execScript( data );
        else if(jQuery.browser.safari)
            // safari doesn’t provide a synchronous global eval
            window.setTimeout( data, 0 );