gpt4 book ai didi

javascript - 使动画函数在执行 $.ajax 调用时起作用

转载 作者:行者123 更新时间:2023-12-02 18:21:22 24 4
gpt4 key购买 nike

我在进行这项工作时遇到了问题。我正在使用 JQuery 2.0 ...

我尝试了此操作,但在 ajaxStart 对象上遇到了异常错误。

$.ajax({
//Scripts here...
}).ajaxStart(function() {
animationStart(); // Display the busy animation...
}).ajaxStop(function() {
animationStop(); // Hide the busy animation...
});

最佳答案

请参阅documentation :

从 jQuery 1.8 开始,.ajaxStart() 方法只能附加到 document

$(document).ajaxStart(animationStart).ajaxStop(animationStop);

关于javascript - 使动画函数在执行 $.ajax 调用时起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18794789/

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