Home » , , » 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 <BODY> 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.
Share this article :

0 comments:

Post a Comment

 
Copyright © Online Business - All Rights Reserved
Proudly powered by Blogger