Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 196855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:48:11+00:00 2026-05-11T16:48:11+00:00

I’m using a jQuery and the tablesorter plugin in my web page. My goal

  • 0

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.

$(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({}); 
});

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:

<th class=""><a rel = "Header" href="#" title="Sort title in decending order" class="">Title</a></th>
<th class=""><a rel = "Header" href="#" title="Sort instructor in descending order" class="">Instructor</a></th>
<th class="{sorter: 'usLongDate'}"><a rel = "Header" href="#" title="Sort column in decending order" class="">Date</a></th>
<th class="">Start/End</th>
<th class=""><a rel = "Header" href="#" title="Sort column in decending order" class="">Seats Available</a></th>
<th class=""><a rel = "Header" href="#" title="Sort column in decending order" class="">Enrolled</a></th>
<th class=""><a rel = "Header" href="#" title="Sort column in decending order" class="">Pre-Requisites</a></th>
<th class="">Workshop Actions</th>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:48:11+00:00Added an answer on May 11, 2026 at 4:48 pm

    Your problem is with this line:

    if ($(this).hasClass('')){$(this).addClass('{sorter: 'false'}'); }
    

    Your quotes inside the {sorter:'false'} are closing out the outer quotes. Try this:

    if ($(this).hasClass('')){$(this).addClass("{sorter: 'false'}"); }
    

    Aside from that, adding a class with that value looks very odd to me but if you’re sure that’s how tablesorter knows not to sort a column then that should work. You could also shorten the selector:

    $("th[class='']").addClass("{sorter: 'false'}");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.