成功和$ .ajax的.done()方法有什么区别

编程入门 行业动态 更新时间:2024-10-27 15:18:36
本文介绍了成功和$ .ajax的.done()方法有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以帮助我吗? 我无法理解$.ajax的success和.done()之间的区别.

如果可能,请举例.

解决方案

简而言之,将成功回调函数与ajax函数解耦,以便稍后您可以添加自己的处理程序,而无需修改原始代码(观察者模式).

请从此处找到更多详细信息: stackoverflow/a/14754681/1049184

Can anyone help me? I am not able to understand the difference between success and .done() of $.ajax.

If possible please give examples.

解决方案

In short, decoupling success callback function from the ajax function so later you can add your own handlers without modifying the original code (observer pattern).

Please find more detailed information from here: stackoverflow/a/14754681/1049184

更多推荐

成功和$ .ajax的.done()方法有什么区别

本文发布于:2023-11-23 19:26:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   方法   ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!