I know this question has been asked multiple times before as how to execute function when all AJAX call has been completed. We can user jquery.stop() in this case. But my requirement is different. I want to show confirm banner when all ajax call have been executed successfully. For different pages , I have multiple AJAX calls. I do not want to put any condition on each AJAX call success method. Can any one suggest if there is any global way.
我知道在所有AJAX调用完成后如何执行函数之前已经多次询问过这个问题。在这种情况下,我们可以使用jquery.stop()。但我的要求是不同的。我想在所有ajax调用成功执行后显示确认横幅。对于不同的页面,我有多个AJAX调用。我不想在每个AJAX调用成功方法上添加任何条件。任何人都可以建议是否有任何全球性的方式。
Thanks in advance.
提前致谢。
1 个解决方案
#1
0
your are searching for global event handlers:
您正在搜索全局事件处理程序:
https://api.jquery.com/category/ajax/global-ajax-event-handlers/
http://api.jquery.com/ajaxcomplete/
anytime when you call an ajax request you "see" it via .ajaxSend()
and handle response via .ajaxComplete()
任何时候你调用ajax请求你通过.ajaxSend()“看到”它并通过.ajaxComplete()处理响应
#1
0
your are searching for global event handlers:
您正在搜索全局事件处理程序:
https://api.jquery.com/category/ajax/global-ajax-event-handlers/
http://api.jquery.com/ajaxcomplete/
anytime when you call an ajax request you "see" it via .ajaxSend()
and handle response via .ajaxComplete()
任何时候你调用ajax请求你通过.ajaxSend()“看到”它并通过.ajaxComplete()处理响应