title: JavaScript Validator keeps saying Unexpected 'if' regarding line 11, and I can't figure out why
body: <p>When I use <a href="http://codebeautify.org/jsvalidate" rel="nofollow">http://codebeautify.org/jsvalidate</a> to validate the code below, it keeps saying line 11 </p>
  
  <pre><code>if ($('#s4-bodyContainer').hasScrollBar().horizontal) {
  </code></pre>
  
  <p>is -- Unexpected 'if' -- and I can't figure out how to fix it.  Here is the complete code.  I am putting it at the bottom of a SharePoint master page to fix an issue with wide tables appearing on certain screens expanding past the branding header and footer.  What this code is supposed to do is detect if there is a horizontal scrollbar in the browser window.  If so, then it is adding some classes to a few div tags that fixes the issue.</p>
  
  <pre><code>(function($) {
      "use strict";
      $.fn.hasScrollBar = function() {
        var e = this.get(0);
        return {
          horizontal: e.scrollWidth &gt; e.clientWidth
        };
      }
      if ($('#s4-bodyContainer').hasScrollBar().horizontal) {
        // has scrollbar so add some classes
        ($("#s4-bodyContainer").addClass("ecs-absolute"));
        ($("#s4-workspace").addClass("ecs-relative"));
      });
  </code></pre>