SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Pop up window when close the browser or leave the site

    Would you visit the link below?

    http://www.macomedia.com


    If you close your broswer or leave the site after you visit the above link,
    A new small page will be pop up.

    How can I make the small pop up window when a user close the browser or leave the site?

    Thanks in Advance

  2. #2
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you would use <body onUnload=""> event

  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    or, alternatively, put this in the <head> of your document:

    <script type="text/javascript">
    onunload=popWin;

    function popWin() {
    window.open('popup.html',winName)
    }
    </script>

    change popup.html to be the page you want to pop up. Google window.open to learn more about how that works and parameteres you can set to customize it to better suit your needs.

  4. #4
    SitePoint Enthusiast artycreations's Avatar
    Join Date
    Sep 2004
    Location
    India
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have an extention to this problem. I placed a code on the unload
    event of a page. When i clicked the (X) button of the browser it will
    popup the new window which is correct; but when i refresh the
    page or click some other links on the page, it is not supposed to popup a new window . Do you have any idea on
    how to open a popup window only if i press or click the (X) button of
    a browser ?

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Berlin
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't do it unless you really want to piss people off.

  6. #6
    SitePoint Enthusiast artycreations's Avatar
    Join Date
    Sep 2004
    Location
    India
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JamesCrompton
    Don't do it unless you really want to piss people off.
    It's not that really. The idea is not to annoy people, but to use pop-ups wisely to undertand the visitors better and thereby servin' them exactly what they need. Follow the link below and read the article , u might change ur opinion...
    http://www.entrepreneur.com/article/...1602-1,00.html

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Berlin
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    read the article , u might change ur opinion
    OK, I've read it. My pop-up blocker is still ON, but I'm apparently not statistically significant. Good luck.
    You could stop clicking on links triggering your pop-up by adding an onclick handler to all of them that sets the onunload handler to null...


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
  •