zoukankan      html  css  js  c++  java
  • 修復jquery的tablesorter对加了千分位的数字无法正确排序的bug

    找到函数:
    function getElementText(config, node) {
    var text = "";
    if (!node) return "";
    if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
    if (config.textExtraction == "simple") {
    if (config.supportsTextContent) {
    text = node.textContent;
    } else {
    if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
    text = node.childNodes[0].innerHTML;
    } else {
    text = node.innerHTML;
    }
    }
    } else {
    if (typeof(config.textExtraction) == "function") {
    text = config.textExtraction(node);
    } else {
    text = $(node).text();
    }
    }
    return text;
    }
    把上邊的function改成下邊的即可:
    function getElementText(config, node) {
    var text = "";
    if (!node) return "";
    if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
    if (config.textExtraction == "simple") {
    if (config.supportsTextContent) {
    text = node.textContent;
    } else {
    if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
    text = node.childNodes[0].innerHTML;
    } else {
    text = node.innerHTML;
    }
    }
    } else {
    if (typeof(config.textExtraction) == "function") {
    text = config.textExtraction(node);
    } else {
    text = $(node).text();
    }
    }
    return (text.replace(/,/g,''));
    }

  • 相关阅读:
    Vue技巧小结(持续更新)
    Vue+Webpack常见问题(持续更新)
    webpack模块定义和使用的模式
    vue-cli笔记
    新浪微博怎么知道你没登录
    jquery页面水印插件,支持多行水印、行错开
    浏览器并发连接数(未完成)
    HTTP1.0 、1.1
    你总说时间很少
    看小说的这些年
  • 原文地址:https://www.cnblogs.com/see7di/p/5333335.html
Copyright © 2011-2022 走看看