Click to See Complete Forum and Search --> : code to determine mac user

05-21-2001, 10:01 AM
i can determine whether a user is on ie or netscape. is there a code (javascript or otherwise) that will determine whether the user is on a mac or pc? my site is looking poorly on macs, and great on pcs.


05-22-2001, 04:19 AM
Maybe this (havenīt tested):

You can also search for platform redirects at other javascript sources:

06-05-2001, 04:27 PM
You can check within flash, simply by using this lil' piece of code:
version = getVersion();

06-06-2001, 11:36 AM
so what would Mac be? If I had...
if version=mac then...


I know it's not in actionscript format, but lingo format is easier to explain what I mean. Also what would PC's value be? I guess I could script it and get the value through a dynamic text box. I'm just curious, holla holla.

06-06-2001, 01:10 PM
Sorry - I thought I typed more than that!

anyway, the code above will return something like version = MAC 5,0,30,0 (<-- this is what mine returned)
and the pc will say version = WIN X,X,X,X
But to use it you'll have to strip out the numbers, so that only MAC or WIN is left.

version = getVersion();
version = version.slice(0,3);

You'll get "version = "MAC"
Then you can use it in any way you need to, if statement, etc.

hope it helps!

[Edited by psychlonex on 06-06-2001 at 01:16 PM]

06-06-2001, 01:19 PM
Ok that will be very useful. I will make a special section that will load for Mac users in my next site design.