title: Finding screen resolution in IE10 on Windows Phone 8
body: <p>I am trying to make a web app for windows phone 8 that requires the full screen resolution</p>
  
  <p>It seems there is no way to discover this</p>
  
  <p>Using: <code>&lt;meta name="viewport" content="width=device-width, user-scalable=no" /&gt;</code></p>
  
  <p>This will always be 320</p>
  
  <p>Using javascript <code>screen.width</code> returns 320</p>
  
  <p>Using javascript <code>screen.availWidth</code> returns 320</p>
  
  <p>I have put together some code that seems to be working for now:</p>
  
  <p>JavaScript:</p>
  
  <pre><code>window.devicePixelRatio = window.devicePixelRatio || screen.deviceXDPI / screen.logicalXDPI;
  var actualWidth = screen.width * window.devicePixelRatio;
  actualWidth = actualWidth - (actualWidth % 2);
  var actualHeight = screen.height * window.devicePixelRatio;
  actualHeight = actualHeight - (actualHeight % 2);
  
  // TEMP FIX!
  if(actualHeight == 1282){
      actualHeight = 1280;
  }
  
  $(window).bind('resize', function() {
      if(window.innerHeight &gt; window.innerWidth){
          // portrait
          width = actualWidth;
          height = window.innerHeight;
      }else{
          // landscape
          width = actualHeight;
          height = window.innerHeight;
      }
  
      $('html').css('width', width);
      $('body').css('width', width);
  }).trigger('resize');
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>@media screen and (orientation:portrait) {
      @-ms-viewport { width: 720px; }
  }
  @media screen and (orientation:landscape) {
      @-ms-viewport { width: 1280px; }
  }
  </code></pre>
  
  <p>Is there a better way to find the true screen resolution on windows phone 8?</p>
  
  <p>Any help/advice on this problem would be much appreciated, thanks!</p>