简体   繁体   English

关于为什么我不能运行这个简单的jquery tablesorter插件示例的任何建议?

[英]Any suggestions on why I can not run this simple jquery tablesorter plugin example?

Sorry for the lame question. 很抱歉这个la脚的问题。

I am trying to run a simple getting started tablesorter example with no luck. 我正在尝试运行一个简单的入门表排序器示例 ,但运气不好。

I know my jquery works because I made a 'hello world' alert test. 我知道我的jquery有效是因为我做了一个“ hello world”警报测试。

I downloaded the .js files and placed them in my working directory/folder. 我下载了.js文件,并将它们放在我的工作目录/文件夹中。

Firebug "Reponse" window shows me there is actual .js code in the files. Firebug“响应”窗口显示文件中存在实际的.js代码。

Firebug says Status: "304 Not Modified", Doamin: "localhost". Firebug说状态:“ 304未修改”,Doamin:“本地主机”。

I am usimng WAMP. 我正在使用WAMP。

<head>


<script src="jquery1.4.2.js" type="text/javascript"></script>
<script src="jquery.tablesorter.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() 
            { 
                $("#myTable").tablesorter(); 
                $("a").click(function() {alert("Hello world!")} );
            }
        );  
</script>



</head>

<body>
<a href="">Link</a>

<table id="myTable"class="tablesorter" border="2" cellpadding="0" cellspacing="1" > 
<thead> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td>Smith</td> 
    <td>John</td> 
    <td>jsmith@gmail.com</td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 
<tr> 
    <td>Bach</td> 
    <td>Frank</td> 
    <td>fbach@yahoo.com</td> 
    <td>$50.00</td> 
    <td>http://www.frank.com</td> 
</tr> 
<tr> 
    <td>Doe</td> 
    <td>Jason</td> 
    <td>jdoe@hotmail.com</td> 
    <td>$100.00</td> 
    <td>http://www.jdoe.com</td> 
</tr> 
<tr> 
    <td>Conway</td> 
    <td>Tim</td> 
    <td>tconway@earthlink.net</td> 
    <td>$50.00</td> 
    <td>http://www.timconway.com</td> 
</tr> 
</tbody> 
</table> 



</body>

替代文字

It worked fine for me when I ran your HTML through jsfiddle ( link here ). 当我通过jsfiddle运行您的HTML时,它对我来说很好( 链接此处 )。 I know that the default jQuery filename is jquery-<version>.js , and I see that your source is missing the hyphen. 我知道默认的jQuery文件名是jquery-<version>.js ,并且我看到您的源缺少连字符。

You said that the source shows up correctly in both of your files, though, so I'm not sure what's wrong here. 您说过,虽然两个文件中的源都能正确显示,所以我不确定这里出了什么问题。 Maybe something within jQuery expects the default filename? 也许jQuery中的某些功能需要默认文件名?

I forgot to download the CSS files and make my web page aware of them! 我忘记下载CSS文件,并使我的网页知道它们了! woops!! 呜呜!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM