i need a java script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roseyrid
    Confirmed User
    • Feb 2002
    • 1058

    #1

    i need a java script

    anyone know where I can get a java script for exit popup.

    If someone closes my page, a new page opens, but if they continue through it wont popup.

    thanks,
    rosey
  • Gemini
    Confirmed User
    • Jan 2001
    • 7183

    #2
    A 'blur' might be better than a new open... tics off the surfer less from our experience.
    <center><a target="_blank" href="http://dev.datedollars.com/index.php?s=signup&amp;aid=535&amp;cfg=aac"><img border="0" src="http://216.130.172.224/gfy/gsig.gif" width="490" height="100"></a><br><a href="http://dev.datedollars.com/index.php?s=signup&amp;aid=535&amp;cfg=aac" target="_blank"><b><font face="Arial"><font color="#FF99FF"> Buy me away from Slavedriver Smokey!<br>It's May Sig Sweeps!<font></b></center>

    Comment

    • ServerGenius
      Confirmed User
      • Feb 2002
      • 9377

      #3
      Hi there,

      This sets a cookie so it will only pop-up once per session
      it's loads the window on exit and is blurred.

      PHP Code:
      
      <SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
       <!--
      var win=null;
      function NewWindow(mypage,myname,w,h,pos,infocus){
      if(GetCookie("sid") == "999"){return;}
      document.cookie="sid=999; Path=/; Expires= " + getFuture(999);
      if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
      if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
      else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
      settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
      win.blur();}
      
      function getFuture(f){
      var d = new Date();
      d.setTime(d.getTime() + (86400000 * f));
      return d;
      }
      
      function GetCookie (name) {
      var arg = name + "=";
      var alen = arg.length;
      var clen = document.cookie.length;
      var i = 0;
      while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
        return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
        }
        return null;
        }
      
      function getCookieVal (offset) {
      var endstr = document.cookie.indexOf (";", offset);
      if (endstr == -1)
        endstr = document.cookie.length;
        return unescape(document.cookie.substring(offset, endstr));
      }
      // -->
      < /script>
      
      
      <body onUnload="NewWindow('http://www.domain.com','byewindow','640','480','custom','back');"return false " onFocus= "this.blur();"> 
      
      DynaMite
      Last edited by ServerGenius; 04-13-2002, 02:41 AM.
      | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

      Comment

      Working...