Domino Code Fragment

Code Name*
Testing for browser type
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.142.12.240
Description*
The following example tests for the browser type and version.
Type*
JavaScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

//if an unsupported JavaScript browser is encountered, inform them of our requirements...
function nogo() {
document.write ( "<FONT SIZE=4>Note: To use this version of
SiteCreator, you must use Netscape Navigator 3.01+ or Microsoft
Internet Explorer 3.01+." );
}


//redirect the browser to its specific code
function go() {
href = location.href.toLowerCase(); //compare against lowercase href
for ".nsf"
pos=href.lastIndexOf ('.nsf', href.length-1);
dbPath=href.substring (0, pos+4);
winopts =
"toolbar=no,location=no,directories=no,status=no,menubar=no,
scrollbars=yes,resizable=yes";


//we currently only differentiate between Netscape Navigator &
Internet Explorer browsers, but here we could do version-specific
things
view = ( ver == "nn3" || ver == "nn4" ) ?
"/$nn/frameset?OpenDocument&A$nn" :
"/$ie/frameset?OpenDocument&A$ie";
//open a new window
imgWindow=window.open( dbPath + view,"Frameset", winopts);
}


//check for our JavaScript-supported browsers
if ( ver == "nn3" || ver == "nn4" || ver == "ie301" || ver == "ie302" || ver
== "ie4" ) {
go();
location= "/cntlcr.nsf"
} else {
nogo();
}
//-->
</SCRIPT>