Non-jQuery initialisation not work
Non-jQuery initialisation not work
i use this example: https://datatables.net/examples/non_jquery/init.html
i init table:
var datatable = new DataTable(document.querySelector('.table_class'));
...come code.....
open page and "Uncaught ReferenceError: jQuery is not defined"
!function(n) {
"use strict";
"function" == typeof define && define.amd ? define(["jquery"], function(t) {
return n(t, window, document)
}) : "object" == typeof exports ? module.exports = function(t, e) {
return t = t || window,
e = e || ("undefined" != typeof window ? require("jquery") : require("jquery")(t)),
n(e, t, t.document)
}
: window.DataTable = n(jQuery, window, document)
in example page i see, that use https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js
no jquery version?
This question has an accepted answers - jump to answer
Answers
The example still requires jQuery on the page - have you loaded that library?
If that doesn't help, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
i not use jquery on my project.
i download datatable from this page - https://datatables.net/download/
and not select jquery.
Yep, you need to also include jQuery - as the text on the example states :
You can either add that dependency in the download page, i.e. this, or just add yourself,
Colin
thanks! i add to packages jquery.
it is planned to remove jquery as a dependency?
Here is one of a few threads discussing this. Sounds like the answer is no.
Kevin