Confirm navigating away with a url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • celery6541
    New Member
    • Mar 2007
    • 15

    Confirm navigating away with a url

    Hi all, Is there a way to confirm that a user wants to navigate away from a page when they type something in the url bar and hit enter?
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Celery.

    99.999% of the time, if you bug a User when he's trying to leave your site, there's a good chance that you are ensuring that he won't come back.

    The event you are looking for is document.onunlo ad(), traditionally included as part of the BODY element:

    [code=html]
    <body onunload="...">
    [/code]

    Comment

    Working...