Recent Articles

Understanding And Building Your Site Links
Most SEOs have a love/hate relationship with links. We love a good link but we hate what it takes to get them. At best, link building is time consuming and tedious. At worst it's the thing drives good SEOs to the...

Optimizing SEO Through Link Architecture
Many webmasters focus a majority of their time on building new links to their site with a variety of link building methods. While this is certainly an...

Understanding The Differences Of Robots.txt...g
It has become common practice to implement robot.txt files to prevent the search engine spiders from crawling your webpage and having it show up in the search engine results page (SERP). Unfortunately, robots.txt...

How To Valuate Your Page Elements
It might seem elementary, but there isn't much study around the value of the various HTML page elements in search engine results pages (SERPs). For SEO professionals there are always discussions...s

8 Ways to Increase Traffic on Your Website
Increasing traffic on your website is like increasing customers who enter the doors of your business. It can have positive, long-term effects for you and the services you are trying to provide. Whether you have...


04.06.10

How To Auto-detect That Someone Is On An iPad Web Browser

By Dave Taylor

I'm working on my Web site and now that the Apple iPad is out, I'd like to customize my greeting for people using that device. How can I auto-detect that they're on an iPad?

Dave's Answer:

There are a ton of tools to help you with this particular task, and I've written about it before too (see How to detect an iPhone web browser). The basic idea is that every Web browser on every hardware platform sends what's called a USER_AGENT identifier. Almost all of the time they're accurate, but some test browsers have the ability to pretend they're something else (known in the biz as "spoofing", actually).

On my Mac OS X system, for example, when I am hitting Web pages within Google's Chrome browser, here's what is sent to the Web server
for each and every transaction I do, whether an HTML page, PHP search result or even ask for a photo or other image:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.347.0 Safari/533.2

You can check your Web browser too. Just pop over to Microsystools and find out.

Now, the question of the moment is, what string does it show when you're on an Apple iPad?


Here's the answer:

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version /4.0.4 Mobile/7B367 Safari/531.21.10

Pretty ugly, really, but the key thing to notice is that the first word within parens identifies the hardware platform. If you're writing code of some sort, simply grab the USER_AGENT string, then check that first word.

Oh, if you're on an iPhone and you go to the same page, here's the USER_AGENT you are sending on each query:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version /4.0 Mobile/7E18 Safari/528.16

Good luck!

Comments

About the Author:
Dave Taylor is known as an expert on both business and technology issues. Holder of an MSEd and MBA, author of twenty books and founder of four startups, he also runs a marketing company and consults with firms seeking the best approach to working with weblogs and social networks. Dave is an award-winning speaker and frequent guest on radio and podcast programs.

AskDaveTaylor.com
http://www.intuitive.com/blog/
About DevWebProAU
DevWebProAU is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProAU delivers via news and expert advice New Strategies In Development.





DevWebProAU is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com






-- DevWebProAU is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2010 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal  

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Delivering IT Solutions DevWebProAU News Archives About Us Feedback DevWebProAU Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact