i use requirejs
load datatable
plug,i got an error $().dataTable()
is not function,
this is my js code:
define(function() {
requirejs.config({
baseUrl: "/Scripts",
paths: {
"jquery": "/Libs/jquery.min"
"jquery.datatable": "/Libs/dataTable/js/jquery.dataTables.min"
},
map: {
"*": {
"css": "/Libs/cssjs/css.js"
}
},
shim: {
"jquery": {
exports: "$"
},
"jquery.datatable":"jquery"
},
waitSeconds: 15,
});})
this is page js
define(["jquery.datatable"], function() {
$(function() {
$("#example").dataTable();
});
});
when i run it ,i got an error on my console :
TypeError: $(...).dataTable is not a function
jquery version is v1.11.0
DataTables version is v1.10.7
RequireJS version is v2.1.11
can u help me? thanks
i solved this question update the requirejs config like this :
});})
Note: the datatables's path,the paths name must be
datatables
.