修复jQuery tablesorter无法正确排序的bug(加千分位数字后)
作者:bea
找到函数: function getElementText(config, node) {var text = "";if (!node) return "";if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;if (config.textExtraction == "simple") {if (config.supportsTextConten
找到函数:
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,'));
}
以上内容是小编给大家介绍的修复jQuery tablesorter无法正确排序的bug,希望对大家有所帮助!
猜你喜欢
您可能感兴趣的文章:
- js中数组结合字符串实现查找(屏蔽广告判断url等)
- 谈一谈js中的执行环境及作用域
- js实现(全选)多选按钮的方法【附实例】
- 用JS生成UUID的方法实例
- 如何通过js实现图片预览功能【附实例代码】
- jquery $.trim()去除字符串空格的实现方法【附图例】
- jquery实现简单的banner轮播效果【实例】
- jquery实现一个简单的表单验证实例
- js实现密码强度检测【附示例】
- 原生javascript实现的一个简单动画效果
- 纯js代码制作的网页时钟特效【附实例】
- JS 实现倒计时数字时钟效果【附实例代码】
- 详解JavaScript for循环中发送AJAX请求问题
- Jquery判断form表单数据是否变化
- 基于javascript实现tab选项卡切换特效调试笔记
- javascript实现数字倒计时特效
- 基于javascript实现样式清新图片轮播特效
- 网页中JS函数自动执行常用三种方法
- Jquery轮播效果实现过程解析