I have an application form that is being handled by jQuery and different AJAX calls. Basically there are five different functions that are being called and if they succeed the next one is being called and so on until the user gets a final answer to their application.
And during this process the user gets feedback about what's happening from a simple dialog window with text that gets updated along the way.
The first two AJAX calls and this third one works without a problem for myself and several others. But some users cant get past the third one. So they get stuck at this point and don't get any output and answer to their application.
The PHP works fine and does its job and returns a correct json-string.
$.ajax({
type: "POST",
url: "/applications/includes/process_formsave.php",
cache: false,
success: function(data) {
var result = jQuery.parseJSON(data);
if(result['status'] == "error") {
processError("31");
} else if(result['status'] == "denied") {
$(".handling-text").text("Handling application");
processOutput();
} else {
$(".handling-text").text("Performing credit report");
processCS();
}
},
error: function(data) {
processError("#32");
},
complete: function(data) {
var result = jQuery.parseJSON(data);
if(result['status'] == "error") {
processError("#33");
} else if(result['status'] == "denied") {
$(".handling-text").text("Handling application");
processOutput();
} else if(result['status'] == "success") {
$(".handling-text").text("Performing credit report");
processCS();
} else {
processError("#34");
}
}
});
At first I didn't have the "complete" part included but read somewhere that if "success" and "error" didn't fire "complete" always will. But it didn't change anything. But I left it in there for safety.
I can also add that a lot of the users use mobile. It works fine on iOS so it might be Android related. But I'm just guessing at this point.
So any ideas what the problem might be?
Edit: After some more testing and inserting some log points i found that the success is in fact called. But the data that is returned is blank. The weird thing is that if I save the json-string to the database before echoing it in the php it looks like it should.