.ajaxStart & .ajaxStop triger with every ajax request
hi
i have a searchbox at the top of my page, using ajax. for sjowing preloader icon, during search process i used something like this:
- //preloader icon
$('#txt_srch').ajaxStart(function() {
$('#txt_srch').addClass('txt_srch_preloader');
}).ajaxStop(function() {
$('#txt_srch').removeClass('txt_srch_preloader');
});
now this preloader shows, everywhere i use ajax in my site. i know despite mentioning $('#txt_srch') before ajaxStart, this method triggers with every ajax requet. but i wonder what are my other options, without using .ajaxStart method?