I need to attached custom JavaScript function to SharePoint 2013 search button click. When user enter some text in search box and click search button or click "Enter" key, my custom JavaScript should also need to execute.
I can see the URL changes whenever user make a new query but it is not loading the entire page.
I added CEWP and added following code.
$(document).ready(function() {
console.log("Log by search button click");
});
It is not writing the in to console log on search button click. It only writes when I reload the page manually..
Please suggest me how to make my custom function execute on every user search.