I need to show a popup message (couple of div tags) when a user tries to do the following:
- Leaves the current SharePoint site and navigates to an external URL.
- Closes the browser.
I tried using the JavaScript onbeforeunload event of the window object through which I could popup the message when the user tries to navigate away from the current page.
But my requirement is to only show him the popup when he tries to leave the SharePoint site and not show him the popup when he navigates to any other page in the same site.
Please help!