Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Tablesorter not sorting columns
    primarykey
    data
    text
    <p>I am parsing an XML file into a table and want to use the jquery tablesorter. Now that I've got the error to go away for tablesorter not existing, my data is populating in the table but the headers are not able to be sorted. Any ideas? Code is listed below for JS and HTML.</p> <p>HTML:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Read XML&lt;/title&gt; &lt;script type="text/javascript" src="jquery-1.7.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.tablesorter.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="custom.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table id="table" border="1"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Item #&lt;/th&gt; &lt;th&gt;Shape&lt;/th&gt; &lt;th&gt;Weight&lt;/th&gt; &lt;th&gt;Color&lt;/th&gt; &lt;th&gt;Clarity&lt;/th&gt; &lt;th&gt;Price($)&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>JS:</p> <pre><code>$(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("&lt;tr&gt;&lt;td&gt;" + $(this).find("id").text() + "&lt;/td&gt;&lt;td&gt;" + $(this).find("shape").text() + "&lt;/td&gt;&lt;td&gt;" + $(this).find("weight").text() + "&lt;/td&gt;&lt;td&gt;" + $(this).find("color").text() + "&lt;/td&gt;&lt;td&gt;" + $(this).find("clarity").text() + "&lt;/td&gt;&lt;td&gt;" + $(this).find("price").text() + "&lt;/td&gt;&lt;/tr&gt;"); }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload