View Full Version : problem with a platform sniffer

02-10-2004, 12:11 PM
I have put on several pages of my website a javascript tocheck if the visitors use Mac or PC platform.
On some computers (PC, Explorer), this script doesn't work and I cannot figure out why.
Find below the code:

function sniffer(CompanyId){
var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
location.href = 'company_mac_index.asp?companyId='+CompanyId;
} else {
location.href = 'company_index.asp?companyId='+CompanyId;
return true;
Thanks for your help

02-10-2004, 12:50 PM
Try using lower case, I presume some browsers may need this

var isMac = (navigator.appVersion.indexOf("mac")!=-1)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum