I was looking for a way to show a status indicator using jQuery and I found a solution in the jQuery cookbook, it showed this solution
(function($) {
$(document).ready(function() {
$('#ajaxStatus')
.ajaxStart(function() {
$(this).show();
})
.ajaxStop(function() {
$(this).hide();
});
.....
})(jQuery);
he warned
If you have performance problems in the application, this may be due to the fact that the cost of the distribution of events, if there is a significantly large number of elements. In this case, setting the global value to false can give you a performance improvement.
So, you should first use the above solution, and will it be a performance issue as my site and js code get bigger and bigger?
Should I avoid jQuery global events, just disable it, as the paragraph says?
, , , , ajax?