Popup script help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tuga
    Confirmed User
    • Nov 2002
    • 7678

    #1

    Popup script help

    Can you show me how to fire a popup only if the surfers closes the page in the first couple of seconds? I think this can be done in j-a-v-a-s-c-r-i-p-t but I'm not sure.

    Go Fuck Yourself!
    ICQ 101411627
  • SMG
    Confirmed User
    • Aug 2003
    • 1798

    #2
    you'd probably want to do something like a function called on body onLoad that does this:
    var today = new Date();
    var then = today.getTime();

    then on body onUnload do:
    var today = new Date();
    var now = today.getTime();
    if (now - then < 10000) {
    put popup code here
    }

    the getTime method gets milliseconds since beginning 1970, so if u compare the one when the page opened to the one when it closed, you can figure out how long it was opened, and based on that do the popup.
    TGP Webmasters: sign up for the top 100 tgp list!
    Submit galleries
    If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.

    Comment

    • SpoinkDexter
      Confirmed User
      • Feb 2004
      • 111

      #3
      That is brilliant! WDITOT?



      Spoink

      Comment

      Working...