Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery issue copying script
    text
    copied!<p>I'm simply trying to get this script to work that I found over here: <a href="http://jsfiddle.net/MJ9Zw/" rel="nofollow">http://jsfiddle.net/MJ9Zw/</a> It does not sort. </p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var table = $('table'); $('#facility_header, #city_header') .wrapInner('&lt;span title="sort this column"/&gt;') .each(function(){ var th = $(this), thIndex = th.index(), inverse = false; th.click(function(){ table.find('td').filter(function(){ return $(this).index() === thIndex; }).sortElements(function(a, b){ return $.text([a]) &gt; $.text([b]) ? inverse ? -1 : 1 : inverse ? 1 : -1; }, function(){ // parentNode is the element we want to move return this.parentNode; }); inverse = !inverse; }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;th id="facility_header"&gt;Facility name&lt;/th&gt; &lt;th&gt;Phone #&lt;/th&gt; &lt;th id="city_header"&gt;City&lt;/th&gt; &lt;th&gt;Speciality&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CCC&lt;/td&gt; &lt;td&gt;00001111&lt;/td&gt; &lt;td&gt;Amsterdam&lt;/td&gt; &lt;td&gt;GGG&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;JJJ&lt;/td&gt; &lt;td&gt;55544444&lt;/td&gt; &lt;td&gt;London&lt;/td&gt; &lt;td&gt;MMM&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;AAA&lt;/td&gt; &lt;td&gt;33332222&lt;/td&gt; &lt;td&gt;Paris&lt;/td&gt; &lt;td&gt;RRR&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Edit: I know this looks silly, but I have been staring at this for a couple hours. I know I am missing something obvious, but I have know idea where it is. I have tried two or three different jQuery libraries, but that did not fix it. I have copied it half a dozen times. I apologize in advance for pasting the whole thing, but I am not seeing it. I know I am missing something very obvious.</p>
 

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