What is wrong with my IF statement in javascript & jquery?
<p>Basically I am hacking a foxycart setup I run and I need to basically hide a certain shipping option should a few things on the page exist...</p>

<p>1) that $value != United States  (this is pulled dynamically from a text input but for purposes of showing you I've made it a static variable here<br />
2) the number '.fc_cart_item' occurs is only once<br />
3) the text in '.fc_cart_item_quantity' is only 1<br />
and<br />
4) the text in #fc_cart_table contains either Xyz or Zyx  </p>

<p>Here is my statement that kinda works... </p>

<pre><code> var value = 'Australia';

if(    
 (    $value != 'United States'    &amp;&amp;    $('.fc_cart_item').size() &lt; 2    &amp;&amp;    $('.fc_cart_item_quantity').text() &lt; 2    )    &amp;&amp;    
 (    $('#fc_cart_table:contains(\'Zyx\')')    ||    $('#fc_cart_table:contains(\'Xyz\')')    )    
)

    {

       // do stuff

     }
</code></pre>

<p>Now this was working (whatever I put in // do stuff would occur) as I expect it when I had Xyz or Zyx in the cart... but then it was still doing stuff even when it was something other than Xyz or Zyx.</p>

<p>I'm coming from a PHP background so I don't know if I'm doing my if statement correctly here. </p>
