我一直在尝试使用tablesorter插件described here对我的表执行排序,现在几个小时。但是,我似乎无法弄清楚我做错了什么。我甚至试图按照给出的确切例子,但它不适合我。TableSorter插件和其他排序插件无法正常工作
这里是我的代码如下所示:
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://mottie.github.com/tablesorter/js/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("myTable").tablesorter();
}
);
</script>
</head>
<body>
<cfoutput>
<table id="myTable" class="tablesorter">
<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>[email protected]</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>[email protected]</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
</cfoutput>
我原来下载的文件,并指定一个绝对路径src
,但也不能工作。我试图在.cfm(ColdFusion)文件中使用它。
关于发生了什么的任何输入?
抱歉,这不是它。我之前用英镑符号试了一下。我在粘贴代码之前意外忽略了它。 –
@FZ我的演示效果很好,它基于你的代码。你必须有一个不同的问题。如果您使用Google Chrome,请按F12并重新启动您的页面。然后点击“控制台”选项卡,查看您在那里看到的错误。 – Icarus
(由于burninate编辑将此线程推入活动列表...)FWIW,我在OP中运行了.cfm文件中的确切代码。添加单个'#'符号修复了它。会投这个,但显然我已经做了第一次;-)(FZ - 注意,''标记是不必要的,因为在页面中没有cfml代码被评估) –
Leigh