开发者

jQuery Ajax and error handling

开发者 https://www.devze.com 2022-12-27 02:03 出处:网络
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.

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 i开发者_开发技巧s available here
   }

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


Have a look at this question: 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消