$(window).width() not working in IE9
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7016268/window-width-not-working-in-ie9">$(window).width() not working in IE9</a>  </p>
</blockquote>



<p>I'm trying to do some DOM manipulation for responsive web design. In IE this is not working. </p>

<pre><code>var w = $(document).width(); 

if (w &gt; 940) {
console.log("If test");     
} else {
console.log("Else test");
</code></pre>

<p>If I use  window.width, it works in IE but stop working in other browsers. Is there a cross browser way for that?</p>
