BrowserHawk IQ now available! Click here for the full scoop!
Search:
How can I detect Mac users?
Created: 11/19/2001    Updated: 7/29/2002
Q   Can you tell me what code I should use to detect Mac users and redirect them to a different part of our web site?

A   This can be easily accomplished using the Platform property. For Macintosh users, this property will contain a value of Mac, Mac68k, MacPPC, etc. Just check the first three characters returned by the Platform property and if they equal "Mac" (case sensitive) you know the user is on a Macintosh system.

The following code demonstrates how do this using ASP:

set bh = Server.CreateObject("cyScape.browserObj")
if Left(bh.Platform, 3) = "Mac" then
   'handle Mac users however you wish, such as a redirect
   response.redirect "/mac"
end if

Content for non mac users goes here


  
   
  

    FAQ Home  |  Search FAQ  |  Show New Items  |  Ask a FAQ  |  Notify Me  |  Most Popular     
 
 
Copyright © 1994-2020 cyScape, Inc. All Rights Reserved. ()
ASP, ASP.NET, ColdFusion MX, CFMX, JSP, PHP