tablesorter JQuery出错 [英] Error with tablesorter JQuery

查看:63
本文介绍了tablesorter JQuery出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试在我的asp.net MVC 4应用程序中实现tablesorter jquery。我收到以下错误Microsoft JScript运行时错误:对象不支持属性或方法'tablesorter'。我发现在这个网站上发布了类似的问题,我尝试了所有可用的解决方案,并花了大约2天时间来弄明白但没有运气。



这是代码供您审核:

Hi,

I am trying to implement tablesorter jquery in my asp.net MVC 4 application. I am getting the following error "Microsoft JScript runtime error: Object doesn't support property or method 'tablesorter'". I have found similar issue posted on this site and i tried all the posible solutions found and spent around 2 days to figure it out but no luck.

Here is the code for your review:

<pre lang="xml">
<script type="text/javascript" src="../../Scripts/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-latest.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.metadata.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#myTable1').tablesorter();
    });
</script>
@{
    ViewBag.Title = "SortedTable";
}
<h2>SortedTable</h2>
<table id="myTable1">
    <thead>
        <tr>
            <th>Emp ID</th>
            <th>Employee Name</th>
            <th>Designation</th>
            <th>Dept</th>
            <th>DOB</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>100</td>
            <td>Bob</td>
            <td>tech</td>
            <td>CS</td>
            <td>01-01-2005</td>
        </tr>
        <tr>
            <td>101</td>
            <td>Arnold</td>
            <td>tech</td>
            <td>CS</td>
            <td>01-01-2001</td>
        </tr>>
    </tbody>
</table>



有没有人可以指出我上面的代码有什么问题。


could anyone please point me out whats wrong with the above code.

推荐答案

(document).ready(function(){
(document).ready(function () {


('#myTable1')。tablesorter();
});
< / script>
@ {
ViewBag.Title =SortedTable;
}
< h2> SortedTable< / h2>
< table id =myTable1>
< thead>
< tr>
< th> Emp ID< / th>
< th>员工姓名< / th>
< th>指定< / th>
< th> Dept< / th>
< th> DOB< / th>
< / tr>
< / thead>
< tbody>
< tr>
< td> 100< / td>
< td> Bob< / td>
< td> tech< / td>
< td> CS< / td>
< td> 01-01-2005< / td>
< / tr>
< tr>
< td> 101< / td>
< td> Arnold< / td>
< td> tech< / td>
< td> CS< / td>
< td> 01-01-2001< / td>
< / tr>>
< / tbody>
< / table>
('#myTable1').tablesorter(); }); </script> @{ ViewBag.Title = "SortedTable"; } <h2>SortedTable</h2> <table id="myTable1"> <thead> <tr> <th>Emp ID</th> <th>Employee Name</th> <th>Designation</th> <th>Dept</th> <th>DOB</th> </tr> </thead> <tbody> <tr> <td>100</td> <td>Bob</td> <td>tech</td> <td>CS</td> <td>01-01-2005</td> </tr> <tr> <td>101</td> <td>Arnold</td> <td>tech</td> <td>CS</td> <td>01-01-2001</td> </tr>> </tbody> </table>



有谁可以请指出我上面的代码有什么问题。


could anyone please point me out whats wrong with the above code.


这篇关于tablesorter JQuery出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆