Pop-up Cookie???

admin

Administrator
Staff member
I'm trying to create a piece of java-script that I can use to detect a visitors browser type and version when they land on a page within my site, and then display a pop-up window with a message based on the visitors browser type/version. The script also needs to write a cookie so the pop-up window does not display when a visitor views additional pages within the site.

This is what I have so far. I'm just missing the cookie part now. This code is an include file that is refrenced from every page on my site.

<script language="JavaScript">
<!--
var br = navigator.appName
var brv = navigator.appVersion
if(br == "Netscape")
{
if(brv<"5.0")
{
newwindow=window.open("","new1","width=500,height=175");

newwindow.document.write("<font face='arial, helvetica, ms sans serif' size='2'><b>Please note:</b><br><br>Our site is best viewed using Netscape 5.0 or higher browsers. It appears you are using Netscape "+brv+". Please visit <a href='http://www.netscape.com' onClick='window.opener.location=this.href;window.close(); return false'>Netscape</a> for a free copy of a newer version of Netscape.<br><br>If you believe this message is the result of a system error, please contact our <a href='http://www.webdeveloper.com/forum/archive/index.php/mailto:[email protected]'>webmaster</a>.<p align='right'><a href='http://www.webdeveloper.com/forum/archive/index.php/javascript:window.close()'>close window</a></p></font>");

newwindow.document.close();
}
else
{
document.write()
}
}
// -->
</script>
 
Top