views:

320

answers:

4

This should work:

<head>
 <title>Damn</title>
 <script src="jquery-latest.js" type="text/javascript"/>
 <script src="jquery.tablesorter.min.js" type="text/javascript"/>
 <script type="text/javascript">
 $(document).ready(function() {  
  $("#tablesorter-demo").tablesorter();
 }); 
</script>
</head>
<body>
 <table id="tablesorter-demo" class="tablesorter" border="2" cellpadding="0" cellspacing="1">
 <thead>
  <tr>
   <th>First Name</th>
   <th>Last Name</th>
   <th>Age</th>
   <th>Total</th>
   <th>Discount</th>
   <th>Difference</th>
   <th>Date</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>Peter</td>

   <td>Parker</td>
   <td>28</td>
   <td>$9.99</td>
   <td>20.9%</td>
   <td>+12.1</td>
   <td>Jul 6, 2006 8:14 AM</td>

  </tr>
  <tr>
   <td>John</td>
   <td>Hood</td>
   <td>33</td>
   <td>$19.99</td>
   <td>25%</td>

   <td>+12</td>
   <td>Dec 10, 2002 5:14 AM</td>
  </tr>
  <tr>
   <td>Clark</td>
   <td>Kent</td>
   <td>18</td>
   <td>$15.89</td>
   <td>44%</td>
   <td>-26</td>
   <td>Jan 12, 2003 11:14 AM</td>
  </tr>
 </tbody>
 </table>
</body>

But it doesn't.
What am I doing wrong?
NOTE: I don't understand much, but this seems to follow the example on the home page of Tablesorter without errors.
And I know I'll be completely ashamed.

A: 

I just ran this and it worked fine except that I had to put the full path to the table sortet script files because I don't have them.

<script src="http://tablesorter.com/jquery-latest.js" type="text/javascript"></script> 
<script src="http://tablesorter.com/jquery.tablesorter.min.js" type="text/javascript"/>
Matt Smith
+4  A: 

close your script tag properly

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

you have to close it with </script>

Anwar Chandra
+1 for this. You can't close your script tags with self-closing tag, or they won't work. :)
reko_t
A: 

do these 2 actually point to existing files?

<script src="jquery-latest.js" type="text/javascript"/>
<script src="jquery.tablesorter.min.js" type="text/javascript"/>
Nicky De Maeyer
A: 

OK It was because I wasn't closing the tags properly.
Now I have to figure out why the page is generated by jsp with damaged tags.

Thanks everybody, you were so nice and helpfull.

Adrian