Your Guide to Professional
Web Site Design and Development

HTML Tips
HTML Codes
Web Development
Web Design Tips
JavaScript Codes
216 Web Safe Colors
CSS Tutorial
JavaScript Tutorial
ASCII Character Codes

Offering a guide to professional web site design, web page design and web design guidelines

| Web Site Development | HTML Codes | HTML Tips | Web Design TipsJavascript Snippets | 216 Safe Colors | Symbols | CSS Tutorial | JavaScript Tutorial |

Creating a First Visit Web Page Pop Up Window


It's a proven fact that the use of popup windows is an effective marketing technique that produces great results. However, they can be very irritating to your visitors. How can you use this powerful marketing technique without offending your visitors? Compromise and use a popup window that only displays the first time your visitor enters your site.

Place the following code within the <BODY> of your web 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("yourpage.htm", "dispwin",
"width=450,height=455,scrollbars=yes,
menubar=no
");
expire=new Date(expire.getTime()+7776000000);
document.cookie="COOKIE1=here; expires="+expire;
}
// -->
</SCRIPT>

Change the text where indicated in red.

The "yourpage.htm" text specifies the popup window url.

Change the height and width to your preferred window size.

 More Web Design Tips