I am using Ajax to search for cities and Locations, I am facing two main problems First one the query last 5 seconds that is very slow I didn't know how to add a spinner of waiting while search is happening This is part of the code
$('#firstadress').autocomplete({
serviceUrl: '/autosearch',
onSearchStart: function (suggestion) {
$(this).addClass('searching');
/* here where I want to added code */
},
onSearchComplete: function (suggestion) {
$(this).removeClass('searching');
},
How can I ameliorate this question .
Thanks in advance