jQuery tablesorter:过滤器和斑马小部件停止工作后,ajax更新IE8仅

jQuery tablesorter: filter and zebra widgets stop working after ajax update IE8 only

本文关键字:ajax 更新 IE8 停止工作 tablesorter 过滤器 马小部 jQuery      更新时间:2023-09-26

我正在使用版本动态更新表jquery-1.7.2.min,2.7.12分钟;2.4+ widgets -更新于2013年2月24日。

代码在IE9和Chrome中工作良好,但在IE8中,过滤器和斑马小部件在ajax更新后停止工作,排序仍然有效。

<table class="tablesorter">
    <thead>
        <tr>
            <th style="width: 145px;">Orig_Time</th>
            <th style="width: 145px;">Corra_Time</th>
            <th style="width: 120px;">Site</th>
            <th style="width: 120px;">Area</th>
            <th>Reference</th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>
$(document).ready(function() {
 $("table").tablesorter({
    sortList: [[0, 1]],
    widthFixed: true,
    theme: 'green',
    widgets: ["filter", "stickyHeaders"],
    widgetOptions: {
        stickyHeaders: "tablesorter-stickyHeader",
        filter_cssFilter: "tablesorter-filter",
        filter_hideFilters: false,
        filter_functions: {
            3: {
                "Midlands+North": function(f) {
                    return f === "Midlands" | f === "North";
                },
                "Scotland+NI": function(f) {
                    return f === "Scotland" | f === "N.Ireland";
                },
                "South+East": function(f) {
                    return f === "South" | f === "East";
                },
                "Wales+West": function(f) {
                    return f === "Wales" | f === "West";
                },
                "Mid+Nor+Sco+NI": function(f) {
                    return f === "Midlands" | f === "North" | f === "Scotland" | f === "N.Ireland";
                },
                "Sou+Eas+Wal+Wes": function(f) {
                    return f === "South" | f === "East" | f === "Wales" | f === "West";
                }
            }
        }
    }
 });
});
function alarms() {
 $("table tbody").load("includes/alarmsResults.php", function() {
    $("table").trigger("update");
 });
}
window.setInterval(alarms, 10000);

alarmsResults.php只是运行一个sql查询,并返回结果在<tr><td>标签。

如果数据是静态的,但在更新过滤器和斑马停止工作后,IE8可以很好地使用插件。有什么想法吗?

我已经尝试过使用tableSorter 2.1小部件-更新于2012年4月2日和旧的过滤器,它工作,但它没有自定义过滤器选项。

欢呼。

我发现问题了!我在最后一个</tr> <small>$time</small>之后的返回数据中添加了sql查询运行所需的时间。IE8不喜欢它,因为它包含在没有<tr><td>标签的主体中,IE9和chrome只是忽略了它。