title: How to get accurate screen height and width in javascript?
body: <p>I tried several javascript functions but it doesn't work for me. I am building a mobile responsive websites and some of the functions give me different results.</p>
  
  <p>This is the functions I used.</p>
  
  <pre><code>var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
      height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
      swidth = screen.width,
      sheight = screen.height;
  </code></pre>
  
  <p>Browser target: UC Browser, Opera Mini, Chrome, Firefox.
  Note: I am not using jQuery for this project.</p>
  
  <p>Advance thanks to those who will help me. :)</p>