Adding a class to all table headers
<p>I'm using a jQuery and the tablesorter plugin in my web page.  My goal is to add the tablesorter header disable parser to each header whose class is empty using its metadata inline insertion functionality. I have three functions outlined, the first is the class that adds the disable parser to each header with a blank class(""), the second will perform class switching operations on headers that don't have blank classes to begin with and the third will call the actual tablesorter, once all headers are set.</p>

<pre><code>$(function(){
    //Code is supposed to add the disable parser to each header with a blank class
    $("th").each(function(){
        if ($(this).hasClass('')){$(this).addClass('{sorter: 'false'}');
    });
});


$(function() {
    //Code manipulates headers with non-blank classes
}); 

$(function() {
    //Call tablesorter on all tables once their headers are set.
    $("table").tablesorter({}); 
});
</code></pre>

<p>So far the second and third functions work as expected, although I eventually plan on extending the second function even further, once I can get the issues with the first function sorted out.  This leads me to my problem and that is that the first function to add the parser doesn't seem to add the class at all and furthermore, since it's not working properly, it seems to prevent the second and third from working.  These functions will work if I take away the first function; I'm not sure if I have the syntax wrong or if I can even add the parser dynamically in this manner.  Below is a sample of headers from the HTML:</p>

<pre><code>&lt;th class=""&gt;&lt;a rel = "Header" href="#" title="Sort title in decending order" class=""&gt;Title&lt;/a&gt;&lt;/th&gt;
&lt;th class=""&gt;&lt;a rel = "Header" href="#" title="Sort instructor in descending order" class=""&gt;Instructor&lt;/a&gt;&lt;/th&gt;
&lt;th class="{sorter: 'usLongDate'}"&gt;&lt;a rel = "Header" href="#" title="Sort column in decending order" class=""&gt;Date&lt;/a&gt;&lt;/th&gt;
&lt;th class=""&gt;Start/End&lt;/th&gt;
&lt;th class=""&gt;&lt;a rel = "Header" href="#" title="Sort column in decending order" class=""&gt;Seats Available&lt;/a&gt;&lt;/th&gt;
&lt;th class=""&gt;&lt;a rel = "Header" href="#" title="Sort column in decending order" class=""&gt;Enrolled&lt;/a&gt;&lt;/th&gt;
&lt;th class=""&gt;&lt;a rel = "Header" href="#" title="Sort column in decending order" class=""&gt;Pre-Requisites&lt;/a&gt;&lt;/th&gt;
&lt;th class=""&gt;Workshop Actions&lt;/th&gt;
</code></pre>
