BigNoseBird.Com- home Small Logo
The 508 Compliant Guide to 
       Big Nose Bird
BACK

How can I make a window open up automatically the first time a visitor stops by a page? Can I reset it so that repeat visitors will see the window if I update the information in the window?


Here is a small JavaScript that will allow you to greet first time visitors to your site with a pop-up window. If you ever need to update the information contained in popwin.html, simply rename the cookie. As an example, in the code below, it is called COOKIE1. To make it so that nobody has ever been to your site before, change both occurances of COOKIE1 to COOKIE2 and so on...

If you do not see the pop-up window on this page it is because you have already been here. ;-)


source code

Be certain when copying the source code to keep the very 
long line below intact. You will get an error if you split
the line. Have some fun, play with the various options such
as height, width, and scrollbars!

<SCRIPT LANGUAGE="JavaScript">
<!--
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 "here";
    i=document.cookie.indexOf(" ",i)+1;
    if (i==0) break;
  }
  return null;
}
var visit=GetCookie("COOKIE1");
if (visit==null){
   var expire=new Date();
    window.name = "thiswin";
    newwin=open("popwin.html", "dispwin",  
    "width=250,height=300,scrollbars=no,menubar=no");
   document.cookie="COOKIE1=here; expires=Thu 01-01-2004 00:00:00 GMT;";
}
// -->
</SCRIPT>


Find or Give Help on the BBS
 
Home Top E-Mail
If it looks great, it's by Christine
Some Fine Print
© 1997-2003 BigNoseBird.Com®, Inc. All rights reserved. All other trademarks are the sole property of their respective owners. The products that we recommend are only ones that we use. We have no relationship with any of the authors or their companies. We cannot assume responsibility for their ultimate performance or lack of same. We also cannot assume responsibility for either any programs provided here, or for any advice that is given since we have no control over what happens after our code or words leave this site. Always use prudent judgment in implementing any program- and always make a backup first! For further information, please read our Privacy Statement. We can be contacted at webmaster@bignosebird.com.


<reallybig.com>
Web Builder Network Portal
Advertise
on the
Reallybig.com
Network
BigNoseBird Newsletter
Subscribe
Un-Subscribe


Sign up today to receive our low volume newsletter. Tips, tricks, news, and whatever else crosses our minds.
Back Issues
Privacy Statement