我已经使用JQuery从PHP的JSON数据创建了HTML TABLE。创建表后,我尝试附加表分类器(jQuery) ,但它不起作用。怎么解决?代码如下。在JQuery中创建动态html表格后,应用另一个JQuery(表格分类器)
<script type="text/javascript">
$(document).ready(function() {
$.getJSON('listnotice.php', function(data) {
var table = "";
$.each(data, function(index,entry) {
table += '<tr>';
table += '<td>' +entry["title"] + '</td>';
table += '<td>' +entry["content"] + '</td>';
table += '<td>' +entry["date"] + '</td>';
table += '</tr>';
});
table += "</tbody>";
$("#noticeList").append(table);
});
$("#noticeList").tablesorter({debug: false, widgets: ['zebra'], sortList: [[0,0]]}).tablesorterFilter({filterContainer: $("#filter-box"),
filterClearContainer: $("#filter-clear-button"),
filterColumns: [0],
filterCaseSensitive: false});
});
</script>
</head>
<body>
<table id="noticeList">
<thead><tr><th>1</th><th>2</th><th>3</th></tr></thead><tbody>
</tablev>
</body>
</html>
什么不起作用? – jrummell