Applied patch provided by Taku Sano fixing the compression errors.
[jquery.git] / ajax / ajax.js
index 4b062e9..be9c320 100644 (file)
@@ -71,7 +71,7 @@ new function(){
                        return this.bind(o, f);
                };
        }
-}
+};
 
 jQuery.extend({
 
@@ -170,8 +170,12 @@ jQuery.extend({
        
                                // Process result
                                if ( ret ) ret(xml);
+
+                               // Stop memory leaks
+                               xml.onreadystatechange = function(){};
+                               xml = null;
                        }
-               }
+               };
        
                // Send the data
                xml.send(data);
@@ -206,16 +210,17 @@ jQuery.extend({
                
                // If an array was passed in, assume that it is an array
                // of form elements
-               if ( a.constructor == Array )
+               if ( a.constructor == Array ) {
                        // 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
+               } else {
                        // Serialize the key/values
                        for ( var j in a )
                                s.push( j + "=" + encodeURIComponent( a[j] ) );
+               }
                
                // Return the resulting serialization
                return s.join("&");