gpt4 book ai didi

ajax - 为特定的 ajax 请求覆盖 ​​ajaxComplete

转载 作者:行者123 更新时间:2023-12-01 00:54:27 25 4
gpt4 key购买 nike

我的应用程序有一个 ajaxComplete() ,它是在每个 View 页面加载的通用 .js 文件中定义的。我怎样才能覆盖这个或者更好地避免为特定的 $.ajax() 调用运行它。

最佳答案

$.ajax 调用中设置 global: false

来自the API :

Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered.

您的通话将如下所示:

$.ajax({
url: 'http://example.com/',
data: data,
global: false,
success: function() {

}/* etc... */
});

关于ajax - 为特定的 ajax 请求覆盖 ​​ajaxComplete,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4729808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com