I’m trying to add a json string to the DB, and calling a web-service in the URL of the ajax call. The string is inserted in the DB when I step through the code with the chrome debugger. However, if I don’t run in debug mode, I get an error message whose response text is blank.
I know the problem is NOT with the web serbvice as it works fine independantly. Does anyone know why this may happen?
Here’s some code
var object1 = { obj: 'newobj2' };
$.ajax({
type: 'POST',
url: 'saveJSON.asmx/submitToDB',
dataType: 'json',
data: object1,
success: function () { alert("success"); },
error: function (response) {
alert("error: " + response.responseText);
}
});
Probably due to caching. Try setting cache to
falsein the request.