我一直在嘗試使用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