0

I am trying to capture timing for ajax requests triggered using jQuery.
For that I defined functions on jQuery.ajaxPrefilter and options.complete

startTime is set in the function defined for jQuery.ajaxPrefilter and when the function defined for options.complete is invoked I will set endTime. The difference between endTime and startTime is my timing for the ajax call.

But somehow when an ajax response comes with HTML that has "script calls", both jQuery.ajaxPrefilter and options.complete methods are getting invoked.

Why are "script calls" routed through JQuery methods?

ChrisWue
  • 18,612
  • 4
  • 58
  • 83
lucky
  • 414
  • 1
  • 7
  • 19
  • Check this post: http://stackoverflow.com/questions/12763987/how-do-i-get-the-response-time-from-a-jquery-ajax-call – tymeJV Oct 01 '13 at 23:45
  • I went through given link and it tells how to get timming. I am doing similar thing using "jQuery.ajaxPrefilter" and "options.complete" But the issue I am getting is.. when ajax response is an html with script tags.. The script tag requests are also routed through Jqyery methods, this is where problem comes. So for a single ajax call.. if ajax response has 3 script call in it then I am getting timings for total 4 calls.. (1 for actual ajax call and other 3 for script call from ajax response) – lucky Oct 02 '13 at 00:12

0 Answers0