var jqxhr = $.post(url, $("#saveShipAdrs").serialize(), function(response) {
// set form values to view
var fld;
$('#editShipAdrs input[name*="Livraison"]').each(function(){
fld = "#show"+$(this).attr("name");
$(fld).html($(this).val());
});
// set success message
$(".success").html("Shipping address updated");
})
.error(function(xhr, ajaxOptions, thrownError) {
$(".error").html("Shipping address cannot be updated");
alert(xhr.status+"\n"+xhr.statusText+"\n"+thrownError);
});
});
Here “saveShipAdrs” is the id of the form.
This code works fine in FF but not in IE.
in IE it gives
xhr.status = 0
xhr.statusText = error
thrownError = Invalid Argument
I have tried for serializeArray and tried looking for other similar questions but didn’t find the solution.
Dr.Molle suggested, status 0 is returned when the request is cancelled because of a different domain.
Here the issue was, I kept the action attribute of form tag empty to submit on self ( action=”” ).
Which doesn’t mean that the domain is different but when I put the current page’s URL in action attribute, the problem fixed.
If anybody wants to explain in detail that what was the exact issue for empty action, it would be appreciated.