title: Why can't my if statement in jquery detect image size?
body: <p>The If - Else statement in my code below seems to be causing an error. When the image is clicked, I'm trying to have a google window open if the image is 100px by 100px in size, and a yahoo window open in any other circumstance. Any idea what's making the if statement error out?</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  
  $(document).ready(function() {
  $("#testImgID").click(function(){
  
     var imgWidth = $(this).width();
     var imgHeight = $(this).height();
  
     if( imgWidth == 100 &amp;&amp; imgHeight == 100)
     {
          window.open("http://www.google.com");
     else
     {
          window.open("http://www.yahoo.com");
     }
  });
  });
  
  &lt;p&gt;
  &lt;img width="100" height="100" id="testImgID" alt="Setup client email capture.jpg" src="/wg/PayrollSolutions/PublishingImages/RCP_setups_theatrical_assignedTo_table.png" style="margin: 5px"/&gt;
  &lt;/p&gt;
  </code></pre>