Fire javascript/jquery event after search is completed
Hi,
I have 'search-encapsulation' on a page. Whe I go to 'SearchPage', search result is displayed with pagination.
I want to do :-
1. capture when the rearch results are loaded
2. DOM manipulation of the search result DOM
My assumption is, search results are getting loaded through an AJAX request.
Thus I am trying to capture/use GLOBAL ajaxComplete event as below :-
$(document).ajaxComplete(function(event,request, settings) {
console.log('ajaxComplete handler start');
console.log(event);
console.log(request);
console.log(settings);
console.log('ajaxComplete handler end');
});
I have added above handler in skin wrapper 'Page Head Bottom Content' section.
'ajaxComplete' event is getting triggered on page refresh.
But when I click on pagination links to load next search results, 'ajaxComplete' event is not getting triggered.
Can anyone help me in this?
Thanks,
Vaishnavi