Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail NNTP-Posting-Date: Tue, 12 Jul 2011 06:19:32 -0500 Date: Tue, 12 Jul 2011 21:19:21 +1000 From: Andrew Poulos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.javascript Subject: Re: know its ipad References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 32 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 124.168.62.58 X-Trace: sv3-xfELGmSNLbZ8boXCE3l9w+E6RYUME+iT0bjtN4QVQ3If2cmaShUvTNVhBt18Pw4eyjynNiu6Ylzv1KK!WUXXmb8w384YUn70qemhOB6Hd7+xlgJfYlO3rcpLw8klU/Bdt6pE1429KOQ7tHvOl7zmVQKRoG1x!P9Kdubinq60nxGVjqCbX X-Complaints-To: abuse@westnet.com.au X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2603 Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:4095 On 12/07/2011 6:04 PM, Richard Cornford wrote: > Andrew Poulos wrote: >> How can I know if a web page is running on an iPad without >> parsing navigator.platform (ie. without browser sniffing)? > > Start by understanding why you care. The reason for caring will allow > you to narrow in on which aspect of the difference between 'running on > an iPad' and 'not running on an iPad' is actually relevant to you, and > so the thing that should be the subject of a pertinent test. Rather than have multiple "mini" branches (which have been working fine for years) like e = e || windows.event I want to one branch to a separate block of code that I can code/test without having to simultaneously deal with whatever issues Android, Windows... etc may bring. So when the client says, "this needs to work on an iPad" I can be confident it does. My clients "know" about web development and are expecting that development that includes the iPad and other mobile devices to be relatively straightforward when in fact I'm struggling. For example, why is it that: 1. Apple says the iPad screen resolution is 1024 x 768 2. designing as 980 x 660 appears to fit appropriately. The page has this meta element: 3. window.innerWidth/Height returns 768 x 518 Andrew Poulos