display alert box using java script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azgaranoop
    New Member
    • Mar 2008
    • 1

    display alert box using java script

    Hi,
    i want to display a alert box when a user leave my site....
    Means if a user clck on X button i.e on top right corner of the browser or the user click on the address bar and try to change the address then a alert box display..

    Simply display a alert box when a user is about to leave my site throught any of these two ways discuss above.....

    please provide me code for this........


    Thanks
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use onunload, but use it with caution. The last thing you want to do is annoy your users.

    Comment

    Working...