SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to automatically open a new window when you close a window

    I'm pretty new with Javascript and I'm just trying to figure out how to open a new window that basically says thank you for visiting, once someone exits the page.

    I've been throwing around random combinations of window.close() and window.open() all morning with no luck.

    If you know of a way to expediate this process that would be greatly appreciated.

  2. #2
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    window.onunload = function() {window.open( ... );}

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <body onunload="alert('thank you for visiting');">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •