Reputation: 127
I am a newbie to MVC. Please forgive me for this newbie question. I am using JQuery table sorter plugin for sorting a html table. I am using this tablesorter plugin. But this one doesn't seem to work.
My javascript code:
<head>
<title>Test Header</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.min.js"</script>
<script src="~/Scripts/jquery-latest.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function () {
alert("hi");
$("#tab").tablesorter();
}
);
</script>
</head>
HTML Code:
<div>
<table id="tab" class="tablesorter">
<thead>
<tr>
---Header part---
</tr>
</thead>
<tbody>
---Body Part---
</tbody>
</table>
</div>
Please help me. Thanks in advance :)
Upvotes: 0
Views: 1294
Reputation: 427
You don't need to include 2 tablesorter library. You need just one. You could include just the "jquery.tablesorter.min.js".
Look the difference between "file.js" and "file.min.js": What's the difference between jquery.js and jquery.min.js?
And you also need to include jquery library.
Example:
<head>
<title>Test Header</title>
// Here you need to include jquery library
<script src="~/Scripts/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#tab").tablesorter();
});
</script>
</head>
Upvotes: 1
Reputation: 2195
You need to include the jquery library before the tablesorter.js
and just include one of the tablesorter js files
Upvotes: 2