screen resolutions using javascript
<p>I am making an application like Analytics, and want to find screen-resolution using JavaScript.</p>

<p>All the analytics tools, that are available right now (be it Google Analytics, Piwik, OWA, or any other), all of them provide screen-resolution detection.</p>

<p>How can I achieve the following?</p>

<p>EDIT: I think You all go wrong. I am making a tool similar to Analytics</p>

<p>EDIT 2: If you are familiar with Google Analytics, it provides with a tracking code (which is in JavaScript). When page gets loaded, script executes and you get a hit.</p>

<p>EDIT 3: I believe that community people got my question in wrong sense. I thought that everyone here would be familiar with Google Analytics code, But I think I have to show an example of how GA code looks like.</p>

<p>EDIT 4: Here how GA code looks like</p>

<pre><code>&lt;script type="text/javascript"&gt; 

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-123456789-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt; 
</code></pre>
