ism ism - 1 month ago 5
Ajax Question

how to get ajax duration from ajaxError

Is there a way to extract the duration that an ajax request took from the ajaxError call?

$(document).ajaxError(function (event, jqXHR, ajaxSettings, thrownError) {

});

Answer

I think using beforesend() and complete() is the easiest way to calculate it.

Getting AJAX Request Duration