Using document importNode otherwise IE pukes

This commit is contained in:
Sarven Capadisli 2009-10-30 15:59:24 +00:00
parent 73e8c44240
commit e134f7ceb1

View File

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