jQuery STOP user from page exit - window beforeunload event

If you try to hit browser back button or Reload the page it should stop and alert the user, whereas if you click on the button or the link below it should just let you move forward.

Go to MySampleCode.com
Copyright © 2011-2012 mysamplecode.com, All rights reserved.