title: capture user leaving page with jquery
body: <p>I want to implement a feature that if a user is navigating away from a page and they have unsaved changes on the page they get alerted. So I need to capture the event that fires to movement from the page and perform custom actions on it. Hoping to do this with jquery. Any tips?</p>