TypeError:$(..).tablesorter不是只在iPad上抛出的函数

TypeError: $(...).tablesorter is not a function thrown only on iPad

本文关键字:iPad 函数 tablesorter TypeError      更新时间:2023-09-26

我在尝试加载表分类器时收到以下错误代码:

"TypeError: $(".tablesorter").tablesorter is not a function. (In '$(".tablesorter").tablesorter({sortList:[[0,1]]})','$(".tablesorter").tablesorter'is undefined)

在桌面浏览器(Chrome、FF、IE)上运行代码效果完美,在android手机上也能运行。

这是一把小提琴(碰巧在ipad上也能用):https://jsfiddle.net/cvuca2mx/

我正在我的服务器上按以下顺序加载文件:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.25.0/js/jquery.tablesorter.min.js"></script>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/intro.js/1.1.1/introjs.min.css"/>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/intro.js/1.1.1/intro.min.js"></script>
<link rel="stylesheet" type="text/css" href="/commonUI/commonUI.css" />
<script src="/commonUI/commonJS.js"></script>

我已经验证了我的文件只加载了一次,因为这是其他人的常见问题。如果我直接将CDN的JS for tablesorter放入我的commonJS文件中,并删除对CDN的调用,iPad就可以正常工作。

有没有其他人在ipad上遇到过类似的问题,或者有什么建议?

jquery.tablesorter.js文件由供应商更新。

新类是"tablesorterPager"而不是"tablesorter"

截至更新的jquery.tablesorter.js

"(function($) { $.extend({ **tablesorterPager**: new function() { ......"

问候