获取应用程序中实时http请求的信息

Getting info of live http request in application

本文关键字:请求 信息 http 实时 应用程序 获取      更新时间:2023-09-26

在JavaScript中是否有办法获取所有正在进行的http请求的信息

使用jQuery可以使用Ajax事件API

.ajaxSend () http://api.jquery.com/ajaxsend/

.ajaxComplete () http://api.jquery.com/ajaxcomplete/

完整的jQuery Ajax事件列表: https://api.jquery.com/Ajax_Events/

的例子:

$(document).ajaxSend(function(){
    alert('Sending an Ajax request.');
})