$(...).tabulator is not a function.....

最近做的网站需要用到tabulator作为前端的数据展示,之前一直用3.5的版本,但到了4.0的版本之后,引用js就出现了$(...).tabulator is not a function的错误,后台发现了新的版本不在依赖jQuery.

The core code of version 4.0 of Tabulator is now dependency free! That means no more jQuery, which means there are a few changes that need to be made to your existing code to get on board with the new way of doing things.

下面是新的引用形式:

var table = new Tabulator("#example-table", {
    //table setup options
});

需要注意的是JS的引用要放在jQuery的前面,要不然会出错。

<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>

参考:
http://tabulator.info/docs/4.0/upgrade

添加新评论