capture navigatinig away from my page

capture navigatinig away from my page

I use

$(window).unload(function(){});

to know that user closes the page.

is there a way to detect user navigating to another page?

thanks