gpt4 book ai didi

javascript - jQuery 表排序器 : filter and zebra widgets stop working after ajax update IE8 only

转载 作者:行者123 更新时间:2023-11-28 09:18:37 25 4
gpt4 key购买 nike

我正在使用版本动态更新表jquery-1.7.2.min,表排序器 2.7.12 分钟,tableSorter 2.4+ 小部件 - 更新于 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 可以与插件一起正常工作,但在更新过滤器和 zebra 后停止工作。请问有什么想法吗?

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

干杯。

最佳答案

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

关于javascript - jQuery 表排序器 : filter and zebra widgets stop working after ajax update IE8 only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15299094/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com