$.widget is not a function

$.widget is not a function

mujahmujah Posts: 8Questions: 4Answers: 0
edited August 2016 in Free community support

I download using https://datatables.net/download/ (Download builder"
choosing:
jQuery 2.x
Bootstrap
IncludeLibrary and tried "No styling library"
Datatables
Extension:All extensions

Packaging options: debug, single file, local files

and added

```<link rel="stylesheet" type="text/css" href="DataTables/datatables.css"/>
and javascript "datables.js"
on my html

I am creating $widget using
$.widget("my.DataTableEditor",
{....

and I got error like
```my.DataTableEditor.js:4 Uncaught TypeError: $.widget is not a function

after I remove datatables.js, there is $.widget.

my main idea here is to , make look and feel as bootstrap.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin
    Answer ✓

    Sounds like you are including jQuery twice on your page. From your description the second is probably in the DataTables download you've created. The download page notes:

    Many pages will already have jQuery included, in which case you do not want to include it again.

    Allan

This discussion has been closed.