SamSaffron / MiniProfiler

A simple but effective mini-profiler for ASP.NET MVC, ASP.NET and Ruby.
http://miniprofiler.com
1.05k stars 221 forks source link

Disable jQuery global AJAX handlers #162

Closed jphpsf closed 11 years ago

jphpsf commented 11 years ago

jQuery allows to define global AJAX handlers which will get fired for every request made with $.ajax or such. See documentation on jQuery API website.

I am currently profiling an app that defines some behaviors for the ajaxStart & ajaxStop handlers. The 2 handlers are triggered when MiniProfiler fetches results. I do not really care about these behavior end would like MiniProfiler to not trigger them. jQuery offers a boolean called global which can be used as an option for $.ajax to disable the global handlers. This pull request sets global to false for the MiniProfiler call that fetches the results and this resolves the problem for me. I thought I'll share this as others might encounter the situation.

BTW, thank you for building this tool, it is so awesome & useful. If you guys are ever in SF, I'll owe you a beer or two :smile: :beers:

SamSaffron commented 11 years ago

Cool, yes this seems reasonable to me! thanks!