...

View Full Version : problem with a platform sniffer



manu
02-10-2004, 01:11 PM
Hi
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;
if(isMac){
location.href = 'company_mac_index.asp?companyId='+CompanyId;
} else {
location.href = 'company_index.asp?companyId='+CompanyId;
}
return true;
}
Thanks for your help

Kor
02-10-2004, 01: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