title: Easiest way in browser to detect mobile phones
body: <p>I use a script generator -- <a href="http://detectmobilebrowsers.com/" rel="nofollow">http://detectmobilebrowsers.com/</a> --  to detect mobile phones in order to redirect the page to a subdomain that has a special template for phones.</p>
  
  <p>I'm only interested in mobile phones only. Ipad, Android tablets will not be redirected. All I need to know is if this script covers IPhone 4 and IPhone 5, because I don't have these models to test it. Anyway, I have tested on Safari using Developer menu - user agent - Safari ios 4.3.3 Iphone, and the page is redirected as needed. Is this enough for what I want or I should use the following script too:</p>
  
  <pre><code>var iphone4 = (window.screen.height == (960 / 2)) ? true : false;
  var iphone5 = (window.screen.height == (1136 / 2)) ? true : false;
  if (iphone4 &amp;&amp; iphone5) {
      parent.location.href='http://www.mobile.mysite.com';
  }
  </code></pre>