Search code examples
javascriptjquerysummernote

Uncaught TypeError: $(...).code is not a function (Summernote)


I don't know if it's the same error as many got here:

jQuery is not a function erreor

how to fix : Uncaught TypeError: $(...).summernote is not a function #2087

jquery: Uncaught TypeError: $(…).error is not a function

But I'm stuck with it like a gum under my shoe.

Here's the actual error on my Chrome's Developer Tools.

Uncaught TypeError: $(...).code is not a function

I just wish to update Summernote from an older version which has this @ sign error.

Cant write @ using AltGr + @ combination or Ctrl + Alt +@Combination #1406

But then, with the newer version from 0.8.0, it seems that the $(...).code() function is no longer available. Any knows the change I should bring to make it work?


Solution

  • From documentation:

    destroy and code

    After v0.7.0, direct jquery methods, destroy and code were removed for avoiding conflict with other jquery libraries. You can call this methods with summernote api.

    The direct jQuery code() function has been deprecated and you now have to use the summernote() function:

    $('#summernote').summernote();