]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Using document importNode otherwise IE pukes
authorSarven Capadisli <csarven@status.net>
Fri, 30 Oct 2009 15:59:24 +0000 (15:59 +0000)
committerSarven Capadisli <csarven@status.net>
Fri, 30 Oct 2009 15:59:24 +0000 (15:59 +0000)
js/util.js

index 10f962fd01f53f86ce1ac97ddbdbcb5976265b50..d1b34542e2a3dd9afc55f527dec2ab67c0693054 100644 (file)
@@ -146,6 +146,7 @@ var SN = { // StatusNet
                 form_id = $(this)[0].id;
                 $.ajax({
                     type: 'POST',
+                    dataType: 'xml',
                     url: $(this)[0].action,
                     data: $(this).serialize() + '&ajax=1',
                     beforeSend: function(xhr) {
@@ -157,9 +158,9 @@ var SN = { // StatusNet
                         alert(errorThrown || textStatus);
                     },
                     success: function(data, textStatus) {
-                        if ($('form', data)[0].length > 0) {
-                            form_new = $('form', data)[0];
-                            $('#'+form_id).replaceWith(document._importNode(form_new, true));
+                        form_new = document._importNode($('form', data).get(0), true);
+                        if (form_new.length > 0) {
+                            $('#'+form_id).replaceWith(form_new);
                             $('#'+form_new.id).each(function() { SN.U.FormXHR($(this)); });
                         }
                         else {