Products 
ASP Source Control
FingerTips
Link Demon
netPROFIT Lite
ASP Knowledge Base
Display your PageRank™
 myLoudASP 
Username
Password
 Latest News 
LoudASP Source Control 2004 released
LoudASP today released the latest update to o...
[Mar 5 2004]

LoudASP introduces upgrade pricing
Today we have introduced upgrade pricing for ...
[Jun 14 2003]

Link Demon 2003 Service Pack 2 Released
LoudASP today released the latest update to o...
[May 18 2003]

 Hot Links 
Banner Exchange Script
Link Exchange Software
Subscription Software
Online Website Builder
Homepage Hosting Scripts
Website Builder
  Home | About Us | Contact Us | myLoudASP | Our News | Our Products | Our Support | Our Sitemap

LoudASP Knowledge Base - JavaScript
Learn how to use Javascript.

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 occurrences of COOKIE1 to COOKIE2 and so on...

Be certain when copying the 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!

Insert the code below under <title>Your Site Name</title> in your page:


<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>


Author: Disabled Cops

Please help us improve our service by rating this FAQ.
1 = poor to 5 = very good
1   2   3   4   5  

This FAQ has been read 3243 times.


Print the Page Script

Print out the page's last update date.

Multiple Submit Buttons

Make your Web Page the Clients Home Page

JavaScript Hello

Is there a way I can have my page automatically remove itself from a frame controlled by another site?

How do I create a "back" button or link on my site?

How can I make a window open up automatically the first time a visitor stops by a page?

 


Home | About Us | Contact Us | myLoudASP | Our News | Our Products | Our Support | Site Map | Resources | Additional Resources
Copyright © 1999 - 2006 LoudASP. All Rights Reserved.