我正在使用 Jquery tablesorter 处理一张桌子,并且我有一个显示 Facebook 喜欢按钮的列(在“喜欢”旁边有计数器的那个)。我想按显示的“喜欢”的数量进行排序。我怎样才能做到这一点?
您可以在这里看到未完成的表格:http: //fx-bar.com/brokers.html 这是我到目前为止所做的(我也刚刚添加了 Tabber 脚本,但我之前也遇到了问题):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/table/jquery-latest.js"></script>
<script type="text/javascript" src="/table/jquery.tablesorter.js"></script>
<script type="text/javascript" src="/tabber/tabber.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#myTable").tablesorter();
}
);
</script>
<script type="text/javascript">
$(document).ready(function()
{
$("#myTable").tablesorter( {sortList: [[1,0]]} );
}
);
</script>
<link rel="stylesheet" type="text/css" href="/table/themes/blue/style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/tabber/example.css" media="screen" />
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="tabber">
<div class="tabbertab">
<h2>Forex Brokers</h2>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Broker Name</th>
<th>Popularity</th>
<th>Min Deposit</th>
<th>Leverage</th>
<th>Promotions</th>
</tr>
</thead>
<tbody>
<tr>
<td>FXPrimus</td>
<td><div class="fb-like" data-href="http://www.myforexspace.org/page/fxprimus-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
<td>$100</td>
<td>500:1</td>
<td>Free 1 on 1 coaching with a professional trader!</td>
</tr>
<tr>
<td>AvaFX</td>
<td><div class="fb-like" data-href="http://www.myforexspace.org/page/ava-fx-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
<td>$100</td>
<td>400:1</td>
<td>Up to $5000 Bonus!</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></div>
<div class="tabbertab">
<h2>Binary Options Brokers</h2>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Broker Name</th>
<th>Popularity</th>
<th>Min Deposit</th>
<th>Leverage</th>
<th>Promotions</th>
</tr>
</thead>
<tbody>
<tr>
<td>FXPrimus</td>
<td><div class="fb-like" data-href="http://www.myforexspace.org/page/fxprimus-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
<td>$100</td>
<td>500:1</td>
<td>Free 1 on 1 coaching with a professional trader!</td>
</tr>
<tr>
<td>AvaFX</td>
<td><div class="fb-like" data-href="http://www.myforexspace.org/page/ava-fx-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
<td>$100</td>
<td>400:1</td>
<td>Up to $5000 Bonus!</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></div>
</div>
</body>
</html>