views:

62

answers:

1

I'm having trouble finding documentation on the jQuery ajax error. I'd like to create a function that is able to get the name of the web service that was called in order to report the error.

Is there a way in the error function to get the name of the function called?

   error: function() {
       //not sure what is available here
   }

I'd appreciate any documentation on what's available in the error function.

+1  A: 

Have a look at this question: http://stackoverflow.com/questions/377644/jquery-ajax-error-handling-show-custom-exception-messages

The error function is :

error:function (xhr, ajaxOptions, thrownError){
  console.dir(xhr);
  console.dir(thrownError);
}

Where xhr is the XMLHttpRequest. You can use FireBug's console.dir to get its attributes.

John Riche