title: Detecting standalone mode in iPhone
body: <p>I am trying to detect if my jquerymobile app is running as an APP (i.e from home screen). My current code is:</p>
  <pre><code>if (window.navigator.standalone)
    Data.isRunningAsApp = true;
  </code></pre>
  <p>Problem is I've heard this code is better according to <a href="http://www.bennadel.com/blog/1950-Detecting-iPhone-s-App-Mode-Full-Screen-Mode-For-Web-Applications.htm" rel="nofollow noreferrer">this</a></p>
  <pre><code>if ((&quot;standalone&quot; in window.navigator) &amp;&amp; !window.navigator.standalone) {}
  </code></pre>
  <p>I get what the first segment is doing (testing is the property exists) but I don't understand the second segment. (From a syntax perspective I thought I did, but it seems contradictory to me!)</p>