SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    popup when page unloads

    how would i make a pop-up open in the centre of any screen (no matter what size) when a viewer leaves a page.
    do i use <body onUnoad>?

    can i modify
    Code:
    <body onUnload="window.alert('YOUR MESSAE GOES HERE')">
    to make it open a popup

    thanks
    munnaz

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd need to use window.open(), but ... why would you want to do such a thing? People with pop-up blockers will be spared from the 'experience' and those who don't have pop-up blockers will probably find out where you live and come round with baseball bats.
    Birnam wood is come to Dunsinane


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
  •