ReferenceError: Can't find variable: jQuery
ReferenceError: Can't find variable: jQuery
Hi all,
I created a simple page with the basic DataTables example using the CDN. This is using the jQuery initialization.
I can get it to work on this page https://fortewebproperties.com/test/f1/ but not this one. https://fortewebproperties.com/test/f6/
I use Rapidweaver Classic on a Mac with Stacks 5.0 and am upgrading from Foundation 1 to Foundation 6. All that is different is the theme being loaded. I don't understand javascript so I'm unable to get past the error that is shown and how to deconflict it.
The error shown in the Page Inspector Console is
ReferenceError: Can't find variable: jQuery
(anonymous function) — jquery.dataTables.min.js:4:336
Global Code — jquery.dataTables.min.js:4:354
Global Code — f6:56
This is what it points to in the jquery.dataTables.min.js file:
I would appreciate any guidance as I am at a loss on how to attempt to fix this. One other data point is I did also try the non-jQuery init and while the page renders, none of the table buttons function.
Thanks,
Mike
Answers
Hi Mike,
This one had me for a few minutes. I believe it is being caused by the
template
tag in thehead
:As MDN says:
That would explain why my browser shows jQuery being loaded before DataTables' JS on your page.
Allan