-2

what is the opposite of -> success: function(data)

 $.ajax({
   type: "POST",
   cache: false,
   url: "/p.php",
   data: info,

   success: function(data){

I want to check if it is not success instead of if it is success...

RGS
  • 4,062
  • 4
  • 31
  • 67

1 Answers1

1

You catch success situation with success function and there is also error function. Please see the documentation http://api.jquery.com/jquery.ajax/

And please see this for detailed xhr catch mechanizm

$.ajax({
    type: "POST",
    cache: false,
    url: "/p.php",
    data: info,
    success: function(data){
        //do something
    },
    error: function(jqXHR, textStatus, errorThrown){
        console.log(errorThrown);
    }
Community
  • 1
  • 1
AnovaConsultancy
  • 106
  • 1
  • 13