ytswy

msg:1490681 | 3:22 pm on Dec 10, 2002 (gmt 0) |
I found this somewhere I forget where. Use the condition: if (navigator.appVersion.indexOf('Mac')!= -1) This will evaluate as true on Macs, otherwise false [disclaimer: I haven't tested it fully since I didn't implement it]
|
SethCall

msg:1490682 | 3:24 pm on Dec 10, 2002 (gmt 0) |
Well, the main site that contains the "ultimate browser sniffer" script (which is very good) is on netscape, and at this time, it seems to be gone ;( So I believe I found the same script at this site [ksu.edu...] the meat of the script you are looking for is a bit farther down.
|
Googly

msg:1490683 | 4:28 pm on Dec 10, 2002 (gmt 0) |
Blimey! I just re-read the title I put in for this thread! BACK? and MAC! A bit different! Must be one of those days! Googly
|
Googly

msg:1490684 | 5:25 pm on Dec 10, 2002 (gmt 0) |
Okay sorry, but i've tried and failed. I'm not exactly great at understanding javascript. Could someone be kind enough to add the required code below to make sure it doesn't work on a Mac. function toggleVisibility(id, NNtype, IEtype, WC3type) { if (document.getElementById) { eval("document.getElementById(id).style.visibility = \"" + WC3type + "\""); } else { if (document.layers) { document.layers[id].visibility = NNtype; } else { if (document.all) { eval("document.all." + id + ".style.visibility = \"" + IEtype + "\""); } } } } Cheers Googly
|
korkus2000

msg:1490685 | 6:22 pm on Dec 10, 2002 (gmt 0) |
if (navigator.appVersion.indexOf('Mac')!= -1){ alert("Wow, you use a Mac!"); }else{ function toggleVisibility(id, NNtype, IEtype, WC3type) { if (document.getElementById) { eval("document.getElementById(id).style.visibility = \"" + WC3type + "\""); } else { if (document.layers) { document.layers[id].visibility = NNtype; } else { if (document.all) { eval("document.all." + id + ".style.visibility = \"" + IEtype + "\""); }}}}}
|
SethCall

msg:1490686 | 9:00 pm on Dec 10, 2002 (gmt 0) |
or maybe var MacIsNotPresent = 1; //this variable should be global, so //your other javascript can find out if it should execute or //not function setMacPresense(){ if (navigator.appVersion.indexOf('Mac')!= -1) MacIsNotPresent=0; //or false } funtion JustAnExample(){ //then, you could prepend all your other scripts with: if(MacIsNotPresent){ //****do all your Windows/Linux stuff*** }else{ //do all your Mac stuff (which is nothing, in this //case) } } <body onload="setMacPresense();"> i guess this should do it!
|
|