title: JQuery/Javascript and the use of && operators
body: <p>I'm trying to get a simple conditional statement to work, and running into problems.  The failing code:</p>
  
  <pre><code>    $(document).ready(function(){
      var wwidth = $(window).width();
  
      if (wwidth &lt; 321) {
          alert("I am 320 pixels wide, or less");
          window.scrollTo(0,0);
      } else if (wwidth &gt; 321) &amp;&amp; (wwidth &lt; 481) {
          alert("I am between 320 and 480 pixels wide")
      }
  });
  </code></pre>
  
  <p>If I remove the else if part of the code, I get the alert.  If I try to use &amp;&amp; or || operators it will fail.  I've Googled, I can't find a reason why it's not working.  I've also tried:</p>
  
  <pre><code>((wwidth &gt; 321 &amp;&amp; wwidth &lt; 481))
  </code></pre>
  
  <p>along with other ways, just in case it's some odd syntax thing.</p>
  
  <p>Any help would be greatly appreciated.  Thanks :)</p>