I'm working on a chat application in which i want to detect and fire ajax when a user leaving a page by clicking back button or some other link or by closing the browser.
So please give your valuable solution how to achieve this.
Thank you all in advance.