且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取AJAX请求持续时间

更新时间:2023-01-05 23:06:51

您可以使用beforeSend()complete()函数比较当前时间戳并计算差异.

You can use the beforeSend() and complete() functions to compare the current timestamps and calculate the difference.

http://api.jquery.com/jQuery.ajax/

在这里您可以看到$.ajax提供的所有回调挂钩: http://api.jquery.com/jQuery.ajax/#callback-functions

Here you can see all callback hooks provided by $.ajax: http://api.jquery.com/jQuery.ajax/#callback-functions