Index: misc/ajax.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ajax.js,v
retrieving revision 1.19
diff -u -p -r1.19 ajax.js
--- misc/ajax.js	22 Sep 2010 21:01:39 -0000	1.19
+++ misc/ajax.js	23 Sep 2010 21:05:46 -0000
@@ -35,7 +35,7 @@ Drupal.behaviors.AJAX = {
     }
 
     // Bind AJAX behaviors to all items showing the class.
-    $('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () {
+    $('.use-ajax').once('ajax-processed', function () {
       var element_settings = {};
 
       // For anchor tags, these will go to the target of the anchor rather
@@ -49,7 +49,7 @@ Drupal.behaviors.AJAX = {
     });
 
     // This class means to submit the form to the action using AJAX.
-    $('.use-ajax-submit:not(.ajax-processed)').addClass('ajax-processed').each(function () {
+    $('.use-ajax-submit').once('ajax-processed', function () {
       var element_settings = {};
 
       // AJAX submits specified in this manner automatically submit to the
@@ -60,8 +60,9 @@ Drupal.behaviors.AJAX = {
       element_settings.setClick = true;
       // Form buttons use the 'click' event rather than mousedown.
       element_settings.event = 'click';
-      // Clicked form buttons look better with the throbber than the progress bar.
-      element_settings.progress = { 'type': 'throbber' };
+      // Clicked form buttons look better with the throbber than the progress
+      // bar.
+      element_settings.progress = { type: 'throbber' };
 
       var base = $(this).attr('id');
       Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
@@ -173,7 +174,7 @@ Drupal.ajax = function (base, element, e
           ajax.form.clk = this.element;
         }
 
-        ajax.form.ajaxSubmit(options);     
+        ajax.form.ajaxSubmit(options);
       }
       else {
         $.ajax(options);
@@ -268,7 +269,7 @@ Drupal.ajax.prototype.success = function
 
   Drupal.freezeHeight();
 
-  for (i in response) {
+  for (var i in response) {
     if (response[i]['command'] && this.commands[response[i]['command']]) {
       this.commands[response[i]['command']](this, response[i], status);
     }
