开发者

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

Sorry for the lame question.

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.

I downloaded the .js files and placed them in my working directory/folder.

Firebug "Reponse" window shows me there is actual .js code in the files.

Firebug says Status: "304 Not Modified", Doamin: "localhost".

I am usimng 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>

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


It worked fine for me when I ran your HTML through jsfiddle (link here). I know that the default jQuery filename is jquery-<version>.js, and I see that your source is missing the hyphen.

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?


I forgot to download the CSS files and make my web page aware of them! woops!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜