0

Is there a way I can get the length of an Ajax request done via jQuery's .load();?

As in the amount of time it takes to send the request and load the elements from the corresponding page?

wordSmith
  • 2,993
  • 8
  • 29
  • 50

1 Answers1

0

Just before the start of the .load, store the current time: startTime = new Date();. In the callback, get the current time again, and subtract the start time. You'll get the elapsed time in milliseconds.

jcaron
  • 17,302
  • 6
  • 32
  • 46