JQuery 表排序器寻呼器插件在边缘模式下无法与 IE11 正常工作



如果您使用带有表上的寻呼机的 Jquery 插件,将不会显示任何数据。数据在那里,但它是隐藏的。

我怀疑插件的浏览器功能检测方法无法处理IE11。

还有人遇到过这个吗?

IE11似乎他的userAgent有问题。一个转折点是更改clearTableBody函数(在jquery.tablesorter-2.0.3.js中工作),如下所示:

this.clearTableBody = function (table) {
    //if ($.browser.msie) {
        function empty() {
            while (this.firstChild) this.removeChild(this.firstChild);
        }
        empty.apply(table.tBodies[0]);
    //} else {
    //    table.tBodies[0].innerHTML = "";
    //}
};

这在某种程度上是由于Internet Explorer 11具有不包含"MSIE"的用户代理字符串,因此jQuery无法正确识别它(请参阅此问题)。

但实际上,TableSorter

Pager 代码不需要知道哪个浏览器正在运行代码。更改函数clearTableBody以利用 jQuery 的跨浏览器实现:
this.clearTableBody = function(table) {
    $(table.tBodies[0]).empty();
};

我已经在IE8,IE9,IE11,Chrome 31和Firefox 24中对此进行了测试。

(刚才,我发现了一个带有 TableSorter 分支的 GitHub 存储库,它可能已经解决了这个问题:https://github.com/Mottie/tablesorter)

我们有同样的问题。我已经直接向Microsoft提交了票证。

等。。。看...

https://connect.microsoft.com/IE/feedback/details/806279/bug-when-sorting-with-a-jquery-plugin

一个简单的

解决方案 - 更改 jquery.tablesorter 中的行.js if($.browser.msie)

if(/msie/.test(navigator.userAgent.toLowerCase()) || window.navigator.userAgent.indexOf("Trident/7.0") > 0)对我有用。

/msie/.test(navigator.userAgent.toLowerCase())检测 IE 版本 10 或更低版本。 window.navigator.userAgent.indexOf("Trident/7.0") > 0检测 IE 11。

最新更新