|
|
 |
Re: FN-FORUM: JavaScript help....
date posted 6th August 2003 14:22
> Can you post the code for
>
> browser_sensing.js
/* Browser sensing */
/* Set up boolian variables to record the browser type */
var isNS4 = 0;
var isNS3 = 0;
var isIE5 = 0;
var isIE4 = 0;
var isIE3 = 0;
var isOld = 0;
// Set up other variables
var docObj;
var styleObj;
var topVal;
/* Determines the browser name and browser version */
var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));
/* reassign variable depending on the browser */
if (brow == "Netscape4")
{isNS4 = 1;}
else if (brow == "Netscape3")
{isNS3 = 1;}
else if (brow == "Microsoft Internet Explorer5")
{isIE5 = 1;}
else if (brow == "Microsoft Internet Explorer4")
{isIE4 = 1;}
else if (brow == "Microsoft Internet Explorer3")
{isIE3 = 1;}
else
{isOld = 1;}
// initalizes our Generic DOM based on the browser
if (isNS4||isIE4){
docObj = (isNS4) ? 'document' : 'document.all';
styleObj = (isNS4) ? '' : '.style';
}
|
 |
|