Issue with Tablesort functionality in Internet Explorer

When testing the code below in Chrome and Safari, it shows up fine with the ability to sort and search for each row. However, when using IE (Internet Explorer), specifically version 10, the functionality is not working – clicking on the refresh link does not trigger anything in IE.

I have two questions: 1. How can I make it work in IE like it does in other browsers? 2. The Desc/Asc arrows are missing, how can I make them appear?

To see the code/example, you can visit this link. You can also refer to the code snippet below.

Thank you for taking the time to read my question. Any help or suggestions would be greatly appreciated.

HTML CODE:

<table id="tablesorter-demo" class="tablesorter"> 
<thead> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td>Smith</td> 
    <td>John</td> 
    <td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="365c455b5f425e76515b575f5a1855595b">[email protected]</a></td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 
<tr> 
    <td>Bach</td> 
    <td>Frank</td> 
    <td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f2949093919ab28b939a9d9ddc919d9f">[email protected]</a></td> 
    <td>$50.00</td> 
    <td>http://www.frank.com</td> 
</tr> 
... (additional rows) ...
<a id="append" href="#">Refresh Page</a>    

JAVASCRIPT CODE:

$(function() {

    var $table = $("#tablesorter-demo");

    $("#append").click(function(e) { 

        e.preventDefault();

        $.ajax({
            type: 'POST',
            url: '/echo/json/',
            data: {
                json: JSON.stringify({
                    table: '<tr> <td>Smith</td><td>Frank</td><td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c3a5b0aeaab7ab83baa2abacaceda0acae">[email protected]</a></td><td>$50.00</td> <td>http://www.frank.com</td></tr><tr><td>Jones</td><td>Frank</td><td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="abcdc1c4c5ced8ebd2cac3c4c485c8c4c6">[email protected]</a></td><td>$50.00</td> <td>http://www.frank.com</td></tr>',
                })
            },
            success: function(response) {

                $table
                    .find('tbody')
                    .html('')
                    .append(response.table);

                $table.trigger("update", [true]);
            }
        });

    });

$table.tablesorter({
    theme: 'blue',

    widthFixed : true,
    
    ... (other options/settings) ...

Answer №1

It appears that there was a discrepancy in the class names assigned by your Table Sorter JS and those specified in the CSS file you included.

For instance, consider the following:

The Class Name for the Header in the JS is 'tablesorter-header'

The Class Name for which the style is defined in the CSS is 'header'

This mismatch also affected the ascending and descending sorting functionalities. By adding specific CSS code in Fiddle, I was able to resolve the issue and now the images are displaying correctly.

table.tablesorter thead tr .tablesorter-header {
    background-image: url(http://tablesorter.com/themes/blue/bg.gif);
    background-repeat: no-repeat;
    background-position: center right;
    cursor: pointer;
}
table.tablesorter thead tr .tablesorter-headerAsc {
    background-image: url(http://tablesorter.com/themes/blue/asc.gif);
}
table.tablesorter thead tr .tablesorter-headerDesc {
    background-image: url(http://tablesorter.com/themes/blue/desc.gif);
}
table.tablesorter thead tr .tablesorter-headerAsc,
table.tablesorter thead tr .tablesorter-headerDesc {
    background-color: #8dbdd8;
}

Regarding Question 2 - It seems there may be an issue with the Table Sorter JS file you are using. Consider trying the one available here.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

retrieving the site's favicon icon

Currently, I am attempting to extract favicons from website URLs using the HtmlAgilityPack library. While I have been successful in retrieving some favicons, there are still some that remain elusive. I suspect that the inconsistency lies in the implementat ...

Leveraging ajax/jquery for sending the stripe.js token to django backend

I am new to integrating payment processing into my Django application using Stripe. Currently, I have set up dj-stripe to handle customers and plans, but I want to use stripe.js to generate a token for securely collecting card information. I prefer not to ...

SSR with Material UI Drawer encounters issue during webpack production build meltdown

When I attempted to utilize the Material UI SSR example provided by Material-UI (Link), it worked successfully. However, my next step was to integrate the Material-UI Drawer into this example. To do so, I utilized the Persistent drawer example code also pr ...

Unwrapping Promises in Angular for Seamless Resolution

I recently started working with Angular and found myself in a large project. I encountered a simplified version of my code below: var beforeClose = function() { var closeDeferred = $q.defer(), a = $q.defer(), b = $q.defer(), c = $q.defer() ...

Different method for adding child elements to the DOM

When creating a DOM element, I am following this process: var imgEle = document.createElement('img');     imgEle.src = imgURL;             x.appendChild(imgEle); Instead of appending the last line which creates multiple img elements ev ...

Determine the percentage of payments, similar to Upwork, by leveraging the power

Currently, I am working on developing a percentage calculation similar to what is seen on the Upwork website. The calculation appears to be accurate when derived from the base amount at a rate of 10%. For instance, if we take a base amount of 89.00, the ...

Tips on customizing Google Analytics code with Google Tag Manager

My website is currently equipped with the Google Analytics tracking code implemented through Google Tag Manager. The standard Google Analytics code typically appears as follows: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']= ...

Exploiting jQuery UI in a Web Browser Bookmarklet

When using CoffeeScript, even though the code is very similar to JavaScript: tabs_html = "<div id='nm-container'><ul><li><a href='#tabs-1'>Guidelines</a></li><li><a href='#tabs-2'& ...

MongoDB has encountered an issue where it is unable to create the property '_id' on a string

Currently, I am utilizing Node.js and Express on Heroku with the MongoDB addon. The database connection is functioning correctly as data can be successfully stored, but there seems to be an issue with pushing certain types of data. Below is the database c ...

Using a variable as a key in Javascript to extract the value of a nested object

Suppose I have this object here: var jsonExample = { "response":{ "result":{ "status":{ "name": "Eric" } } } } Now I want to dynamically access a nested property: var jsonKey = "response.result.status.name"; conso ...

Even after completing all the fields in the form, the type 'null' cannot be assigned to type 'AsyncDefaultValues'

Recently, I've encountered a puzzling warning while trying to retrieve data from my database. The warning mentions something about null | undefined, and I'm perplexed as to where exactly these values are originating from when inspecting the defau ...

Extracting data from a JavaScript React webpage with Python Selenium, targeting an element that disappears shortly after loading

Having trouble with scraping a webpage that features a React element hiding a dropdown after a few seconds. Upon initially arriving at the page, this is what is visible and what I aim to scrape: https://i.sstatic.net/VVY4r.jpg The specific information I ...

The slider causing conflicts with widgets and content positioned below it in an HTML layout

When implementing a slider with a fade effect, there seems to be an issue with the placement of widgets on the homepage. The problem arises from the margin-top setting as when images change in the slider, the widgets clash with the slider. During the trans ...

Is the XMLHttpRequest object closed once the response is received?

Attempting to establish a connection with the server using an XMLHttpRequest object to send data intermittently. The process of creating the object and establishing a connection is as follows: var xhr = new XMLHttpRequest(); xhr.open("post", location, tru ...

Is there a way to manually add route resolve data to a controller without using automatic injection?

Two routes in my application share a controller, but one route requires data to be resolved before the view loads while the other does not. Here is an example of the routing segments: ... when('/users', { controller: 'UsersCtrl', ...

Executing PHP code within an AJAX request

Utilizing AJAX on a website to call a PHP script that parses another page and returns the desired content has been effective for me in the past. However, this time around, when returning a portion of the page that contains PHP code, it is being displayed w ...

Extract the date from the URL and update the chosen date on the jQuery datepicker

After some searching, I've come to ask a question here. I'm dealing with a jQuery datepicker within a form. When the user changes the date and clicks submit, the URL ends up looking like this: index.php?thedate=12%2F22%2F2012#, which really repr ...

Solving the complex problem of integrating database queries and countdowns using Ajax in ASP.Net

I have asked this question several times, but I still don't know what to do. On my website, I have an auctioneer system that requires constant updates and checks. Every second, I need to: Check if any bidder has placed a bid -> Database Query Co ...

Error: Attempting to access index 1 of an undefined property in an array

var grid = []; for (var i = 0;i < 6;i++) { for (var j = 0; j < 6; j++) grid[i] = []; } //Function to determine the number of bombs nearby function check(cx,cy) { var numb = 0; if (grid[cx][cy - ...

Creating an iOS smart banner similar to Facebook's without using the meta apple-itunes-app tag can be achieved by implementing custom

Is there a way to create a smart banner similar to what is seen on Facebook? I'm looking for something that doesn't have a close button and appears more condensed compared to the banners I've created. I found some information on this link. ...