开发者

jQuery Ajax and error handling

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜