jquery ajax method always returning an error?
Posted
by
General_9
on Stack Overflow
See other posts from Stack Overflow
or by General_9
Published on 2012-10-10T03:00:42Z
Indexed on
2012/10/10
3:37 UTC
Read the original article
Hit count: 811
I have the following ajax call and it always hits the error callback function every time it is called. The code in the handler is still run after the error but the success callback is never executed. What have I got wrong?
$.ajax({
type: "POST",
url: "Handlers/TheHandler.ashx",
data: {
control1: $('[id*=control1]').val(),
control2: $('[id*=control2]').val(),
control3: $('[id*=control3]').val(),
control4: $('#control4').val(),
control5: $('[id*=control5]').val(),
control6: $('[id*=control6]').val()
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.readyState);
alert(textStatus);
alert(errorThrown);
},
success: function (returnedValue) {
alert("Got Here");
alert(returnedValue);
}
});
© Stack Overflow or respective owner