0
And I’m having a hard time in Ajax.
I have the following:
beforeSend: function ()
{
$("#btnEvniar")
.prop('disabled', true)
.click(JaClicouProc(3,this));
},
success: function (resultado)
{
FechaDivAg();
swal({
title: "Sucesso!",
text: "Helpdesk enviado com Sucesso.",
showConfirmButton: false,
timer:3000,
html: true
});
$(".cam").each(function () {
$(this).val('');
});
}
The function JaClicouProc()
hangs the screen so that the user does not keep sending several helpdesks...
But it does not enter the successful part of Ajax. this function FehcaDivAg()
unlock the screen.
In the target file of Ajax which is a file. php am giving a echo "true";
Does anyone know why you’re not getting into Success?
Follow function code as requested!
function JaClicouProc(qualmsg, wcam, msgopc)
{
if (typeof(msgopc) != "undefined")
ShowAguarde(qualmsg, msgopc);
else
ShowAguarde(qualmsg);
// ShowAguarde(qualmsg); :MostraAguarde
document.getElementById(wcam.id).blur();
// gab 2016-07-26. Usa a função para não processar duas vezes (a mesma do botão salvar)
return true;
}
If you don’t enter Sucess it’s because you’re locking in beforeSend, it works cascading. As you said yourself, the Jaclicou function hangs, the error must be in it.
– Lucas de Carvalho
Puts the complete Ajax because other parameters can influence the result.
– Sam
even returning true in function jaClose? full ajax is pretty big! put anyway?
– Reculos Gerbi Neto
You’re entering the beforeSend?
– Sam
yes is entering.
– Reculos Gerbi Neto
Take a test: comment all beforeSend and see if you enter Success... if you enter, the problem is in beforeSend.
– Sam
then try giving one instead of
echo "true"
tries to give aecho json_encode( array( 'retorno': true ))
– adventistaam
good... I commented the function and it worked... the code is of the company in which I am working and I can not touch some functions... was the function Jaclicouproc really... Thank you!
– Reculos Gerbi Neto
If you can put what you have in this role to see what’s going on.
– Sam