Link to home
Start Free TrialLog in
Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on

jQuery - Treating error in AJAX call

Hi E's, at some stage of my site I need to use Ajax. I do a call with this code:
$.post("ajax_prev.php",{"nj":numero_jogo, "fase":'3'},function(data, textStatus, jqXHR){}); 

Open in new window

I need to know if that call has been successful. How I know if that call has been successfull?

The best regards, JC
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pedro Chagas

ASKER

Thank you.
You're welcome!
$.ajax({
     method:"POST",
     url:"ajax_prev.php",
     data:{"nj":numero_jogo, "fase":'3'},
     success:function(data, textStatus, jqXHR){},
     error:function(jqXHR, textStatus, errorThrown) { alert( "Triggered ajaxError handler." ); }
}); 

Open in new window