? .settings
Index: misc/ajax.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ajax.js,v
retrieving revision 1.17
diff -u -p -r1.17 ajax.js
--- misc/ajax.js	16 May 2010 19:08:08 -0000	1.17
+++ misc/ajax.js	5 Jun 2010 14:00:25 -0000
@@ -325,9 +325,9 @@ Drupal.ajax.prototype.commands = {
     var method = response.method || ajax.method;
     var effect = ajax.getEffect(response);
 
-    // Manually insert HTML into the jQuery object, using $() directly crashes
-    // Safari with long string lengths. http://dev.jquery.com/ticket/3178
-    var new_content = $('<div></div>').html(response.data);
+    // Add the content in a wrapping div, that will be removed after effects
+    // are applied.
+    var new_content = $('<div class="ajax-temp-wrapper">' + response.data + '</div>');
 
     // If removing content from the wrapper, detach behaviors first.
     switch (method) {
@@ -350,13 +350,17 @@ Drupal.ajax.prototype.commands = {
 
     // Determine which effect to use and what content will receive the
     // effect, then show the new content.
+    var callback = function () {
+      var tempWrapper = $('div.ajax-temp-wrapper', wrapper);
+      tempWrapper.replaceWith(tempWrapper.contents());
+    }
     if ($('.ajax-new-content', new_content).length > 0) {
       $('.ajax-new-content', new_content).hide();
       new_content.show();
-      $('.ajax-new-content', new_content)[effect.showEffect](effect.showSpeed);
+      $('.ajax-new-content', new_content)[effect.showEffect](effect.showSpeed, callback);
     }
     else if (effect.showEffect != 'show') {
-      new_content[effect.showEffect](effect.showSpeed);
+      new_content[effect.showEffect](effect.showSpeed, callback);
     }
 
     // Attach all JavaScript behaviors to the new content, if it was successfully
