我在进行这项工作时遇到了问题。我正在使用 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/