I'm trying to determine, based on the result of this call, if it was successful. The successFunction
doesn't get called, so I'm assuming it was not. How do I know what went wrong?
xmlRequest = $.post("/url/file/", { 'id' : object.id }, successFunction, 'json');
Do I use the xmlRequest object?
You can use:
$.ajax({
url:"/url/file/",
dataType:"json"
data:{ 'id' : object.id }
error:function(request){alert(request.statusText)}
success:successFunction
})
You could use the $.ajaxComplete() and/or $.ajaxError() methods to attach function to those events. I would also recommend using the Firefox browser with the Firebug pluging, you can get a lot of information about the requests and responses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With