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

  • SEARCH
  • Home
  • 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 7159087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:10:20+00:00 2026-05-28T13:10:20+00:00

I am parsing an XML file into a table and want to use the

  • 0

I am parsing an XML file into a table and want to use the jquery tablesorter. I’ve tried many things, of which none have worked. I was parsing the XML file first via AJAX and then calling tablesorter on my table. The way I have my code now, I’m calling tablesorter on my table, running AJAX, and then updating the table with $("#table).trigger("update"). I am getting this error no matter whether I have it the first way or the second way: “$(#table).tablesorter() is not a function”. Any ideas? Code is listed below for JS and HTML.

HTML:

<html>
<head>
    <title>Read XML</title>
    <script type="text/javascript" src="jquery-1.7.1.js"></script>
    <script type="text/javascript" src="jquery-latest.js"</script>
    <script type="text/javascript" src="jquery.tablesorter.js"</script>
    <script type="text/javascript" src="custom.js"></script>
</head>
<body>
    <table id="table" border="1">
        <thead>
            <tr>
                <th>Item #</th>
                <th>Shape</th>
                <th>Weight</th>
                <th>Color</th>
                <th>Clarity</th>
                <th>Price($)</th>
            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</body>
</html>

JS:

$(document).ready(function() {
$("#table").tablesorter();
 $.ajax({
     type: "GET",
     url: "tutorial.xml",
     dataType: "xml",
     success: parseXml
 });
$("#table").trigger("update");
});

function parseXml(xml)
{
    $(xml).find("diamond").each(function()
    {
        $("#table tbody").after("<tr><td>" + $(this).find("id").text() + 
        "</td><td>" + $(this).find("shape").text() + "</td><td>" + $(this).find("weight").text() + 
        "</td><td>" + $(this).find("color").text() + "</td><td>" + $(this).find("clarity").text() + 
        "</td><td>" + $(this).find("price").text() + "</td></tr>");
    });
}
  • 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-28T13:10:21+00:00Added an answer on May 28, 2026 at 1:10 pm

    You are missing a closing >

    <script type="text/javascript" src="jquery.tablesorter.js"</script>
    

    should be

    <script type="text/javascript" src="jquery.tablesorter.js"></script>
    

    Edit:

    As Marek Karbarz points out below, you’re also missing a closing > on this line:

    <script type="text/javascript" src="jquery-latest.js"</script>
    

    Not sure why you’re including jQuery twice, however.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing an XML file into a table and want to use the
I have a problem parsing a XML file which contains special characters like ,
I have an xml file which has many numbers which are formatted incorrectly in
I have this XML file which I parse into an ArrayList In this ArrayList
I have an XML file that I want to parse into a database in
I am parsing an xml file with jquery and ajax. I noticed that it
I got a string from parsing a XML file which looks like this: Fri,
I am parsing an XML feed into a MYSQL table using simplexml_load_file(). Some of
Background: I am parsing a 330 meg xml file into a DB (netflix catalog)
I'm parsing an HTML file into a well-formed XML document using NekoHTML parser. However

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.