JQuery How to find out what the ajax error is?
To see the error message from an AJAX request, you can do something like this:
$.ajax({
type:"POST",
url:"http://mpdomain/WebService.asmx/Operation",
data: "{'parameter1': '44906'}",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function(data) { alert("success") },
error: function(ts) { alert(ts.responseText) } // or console.log(ts.responseText)
});
Note that, inside the error function, you get the responseText
.
The error message jQuery gives you is not very descriptive. It can either be "timeout", "error", "notmodified" or "parsererror." http://api.jquery.com/jQuery.ajax/ so what you can conclude is that it's not a timeout, not modified or parse error that you are getting.
Make sure in Firebug you see the request set to the correct address and the correct data is being set. You can also view the response so if you also have access to the server code a quick and dirty way is just to echo what is going on server side and view the response with Firebug.
Also I'm not sure if this is an issue but try to set the data to {parameter1: 44906} (basically remove the quotes so you are passing in an object and not a string).