ajaxStartajaxStop 事件中,可以使用 this.url 来获取请求的 URL。

示例代码如下:

$(document).ajaxStart(function() {
  console.log('Ajax request started: ' + this.url);
});

$(document).ajaxStop(function() {
  console.log('Ajax request stopped: ' + this.url);
});

在上面的示例中,当 Ajax 请求开始时,控制台会打印出请求的 URL,当 Ajax 请求结束时,控制台也会打印出请求的 URL。

jQuery 中 ajaxStart 和 ajaxStop 获取请求 URL

原文地址: https://www.cveoy.top/t/topic/maCo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录