title: TypeError: $(...) is null error in firebug but code works on jsFiddle
body: <p>You can see my js (and associated html and css) at: <a href="http://jsfiddle.net/twsx7/9/" rel="nofollow">http://jsfiddle.net/twsx7/9/</a></p>
  
  <p>I am working on a tweak to work with Blackboard Learn 9.1 (so if anyone has experiencing with the learning management system, or with the tweaks building block they might have some clue already as to why I am getting this problem).</p>
  
  <p>The change I am making involves checking what course theme is applied and then adding a class to a table based on that so that the table is styled to match the theme.</p>
  
  <p>When i run this on our server I get the error <strong>$(...) is null</strong>  when it reaches <strong>var theme_id = $(".current").attr("id");</strong>. The rest of the JS works (note that the top section of the JS is normally another file that's included on the page, couldn't link it to jsfiddle as its on an authenticated server) </p>
  
  <p>My contributions to this file are (and where the code is failing):</p>
  
  <p>line 242</p>
  
  <pre><code>$unitMap.addClass(getTheme());
  </code></pre>
  
  <p>lines 381 - 385</p>
  
  <pre><code>function getTheme() {
      var theme_id = $(".current").attr("id"); // error occurs this line
      var theme = $("#"+theme_id).find("a").html();
      return theme.toUpperCase();
  }
  </code></pre>
  
  <p>This is my first attempt at jQuery so one of my concerns is that I'm using the wrong syntax for the version of jQuery the code was written with.</p>
  
  <p>I located the following within the code when you select to include a tweak:</p>
  
  <pre><code>&lt;script src='/webapps/qut-tweakbb-BBLEARN/jquery.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script src='/webapps/qut-tweakbb-BBLEARN/jquery.tweakSetup.js' type='text/javascript'&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The code in the top of the jsFiddle is from <strong>jquery.tweakSetup.js</strong></p>
  
  <p>I am hoping I've just used the wrong markup for the version of jQuery (though I can't seam to find <em>what</em> version the original code was written in) any advice would be greatly appreciated.</p>