Extends Jquery ajax complete function

I'm using jQuery ajax to do some requests to the server. I have to add some validations after the content is loaded (error handling). The easiest way is by adding the validation on the `success()` callback. However, I would need to implement that callback in all the implementations I already have. Is there a way to extend the success callback? Something that will be called before the rest of the callback code? This way I can add the validations for each success in ONE place, and be executed every time a success callback is called. I tried `preFilters`, converters, but they don't fit my needs.

以上就是Extends Jquery ajax complete function的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏