I think better to handle this event on navigation link click.
That is handle event click on navigation link click and call the ajax method and then navigate to required url.
Required code will be like below
$("a").click(
function(event){
event.preventDefault();
}
);
}
Hope this will works. Good luck :)