2
I am using, to show that you are loading while sending the client to the web service via php
//Tipo do método
type: "POST",
url: "../Processos/AcCadasCliente.php",
data: $('#formulario').serialize(),
beforeSend: function () {
// enquanto a função esta sendo processada,
// a mensagem "Carregando"
$('#enviar').html('.....');
},
//Quando terminado a função
success: function (txt) {
//Se deu certo, mostrar mensagem, enviado com sucesso
$('#enviar').html('.....');
},
//Em caso de erro
error: function (txt) {
$('#enviar').html('Erro');
}
It happens that even without I have connection with the web service, still, only runs the beforesend and sucess. How to invoke ajax error
Are you sure the web service is not accessible? If there is no connection it should be an error. Do you think you can reproduce the error here -> http://jsfiddle.net/oxu8ux6m/?
– Sergio
I have yes, in php code it enters the Cath, but gets only in this, it does not go to ajax error
– Álysson Alexandre
no código php ele entra no catch
So he is able to connect with the server, IE, the request is not having problems and the functionsuccess
will always be called.– Oeslei
There is no error no request, but there is error in the answer because it is not connected with web service, and it was this error that I wanted to call the javascript error
– Álysson Alexandre