I'm trying to make an application with the phonegap and I have the following problem.
As an example, I have the following function:
function listar(){
var useremail = localStorage.getItem('email');
var userpassword = localStorage.getItem('pass');
var acao = "listar";
$.ajax({
type: 'POST',
url: 'http://www.site.com/funcoes.php',
data: {useremail : useremail, userpassword : userpassword, acao : acao},
beforeSend: function() {
// Loading function...
document.getElementById('loadfunc').style.display = "block";
},
success: function(data) {
$("#wrapper-home").html(data);
},
error: function(xhr) { // if error occured
alert("falha ao carregar");
},
complete: function() {
document.getElementById('loadfunc').style.display = "none";
},
dataType: 'html'
});
}
I was testing the following - I click the button that calls this function and when finished loading I click again. After clicking a few times it starts to fall into the error function.
Funny that using my pc as a server I click endless times and it does not give an error, it was only to go to the hosting service and started giving the problem.
Would anyone have any light of what it could be? Something I can add in the function to know the exact error it is giving or even some configuration on the server that needs to be done. (I'm using godaddy).
Thank you!