Old 28-01-2007, 21:03   #1 (permalink)
hawken
Cornish Pasty
 
hawken's Avatar
 
Join Date: Nov 2003
Location: Tokyo, Japan
Posts: 2,291
Send a message via MSN to hawken
platform detect

anyone got a bit of code for showing content based on platform?

that isn't shit.

cheers!
__________________
  Reply With Quote
Old 29-01-2007, 05:10   #2 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,611
we used this little piece of javascript to detect Firefox on a Mac. Pretty basic stuff and easy adapt to suit your requirements.

Code:
function detectFirefoxMac(){ var userAgent = new String(navigator.userAgent); var platform = navigator.platform; if (userAgent.search("Firefox")>-1 && platform.search("Mac")>-1) { return true; } else { return false; } }

I believe it's possible to spoof your user-agent and platform though, just so you know.
__________________
  Reply With Quote
Old 29-01-2007, 09:14   #3 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Old 02-02-2007, 01:45   #4 (permalink)
hawken
Cornish Pasty
 
hawken's Avatar
 
Join Date: Nov 2003
Location: Tokyo, Japan
Posts: 2,291
Send a message via MSN to hawken
thanks guys. Much kudos. The PHP is a keeper.
__________________
  Reply With Quote
Old 02-02-2007, 02:30   #5 (permalink)
John Good
+
 
Join Date: May 2005
Location: Tropical Networks
Posts: 1,321
wow thanks that's great !
__________________
Fonts are like cologne: A bad choice speaks louder than a good one. Justin Feinstein
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8