First Visit Pop Up Window

 

First Visit Pop Up Window

If you’re looking for a JavaScript code to enable you to create a first visit pop up window for your web site, you’ve come to the right place.

Pop up windows can provide a great way to gain new subscribers to your publication and even increase your sales. However, they can also be very irritating to your visitors.

For this reason, you may want to use a pop up window JavaScript code that will only load the pop up window on your visitor’s first visit. That way you’re not continually harassing them with a pop up window each time they visit your web site.
 
Place the following JavaScript code within the of your web page.

<script language=”JavaScript”>
<!– Script courtesy of http://www.web-source.net – Your Guide to Professional Web Site Design and Development
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(“yourpagename.html”, “dispwin”,
“width=450,height=455,scrollbars=yes,menubar=no”);
expire=new Date(expire.getTime()+7776000000);
document.cookie=”COOKIE1=here; expires=”+expire;
}
// –>
</script>

Edit the JavaScript code for your first visit pop up window to suit your needs.

Replace the words “yourpagename.html” with your pop up window address and edit the window’s width and height to your desired size.

This concludes the First Visit Pop Up Window code.

 
 

 
 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.