Uncaught Typeerror: $(...). tooltip is not a Function

Asked

Viewed 4,720 times

0

This error appears when I press F12, and the Bootstrap data-toggle="tooltip" does not appear on the page anyone can help me?

Uncaught TypeError: $(...).tooltip is not a function
    at HTMLDocument.<anonymous> (conf.js:39)
    at j (jquery-1.11.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2)
    at Function.ready (jquery-1.11.1.min.js:2)
    at HTMLDocument.J (jquery-1.11.1.min.js:2)
  • What does your F12 say on the "sources" list? Most likely, the definition of $.fn.tooltip was not loaded on your page. In fact, post the text of the function that contains line 39 of the file conf.js.

  • $(Function () { $('[data-toggle="tooltip"]'). tooltip() });

  • There is a file in the list of files loaded in the "sources" tab called tooltip.js? From what I understand of Bootstrap, this is the file that has the definition of tooltip(), although it is usually carried inside the bootstrap.js

  • No, before this error has another, Uncaught Error: Popover requires tooltip.js , bootstrap.js:41

3 answers

2


You have not included Bootstrap correctly on your page. For that, it needs a tag <script> within the tag <head>, sort of like this:

<!DOCTYPE html>
<html>
    <head>
        <title>Minha página de Bootstrap</title>
        <meta charset="utf-8">
        <script type="text/ecmascript" src="caminho/para/bootstrap.js"></script>
        <script type="text/ecmascript">
            // funções da página...

And so on. Note that due to some features (read: bugs) of certain ancient browsers, the tags of <script> with an attribute src (that is, those who import files instead of defining javascript in HTML itself) have to have a tag of explicit closure (that is, one cannot say <script type="text/ecmascript" scr="script.js" />).

Having this reference to the Bootstrap file, the tooltip() and the other functions will start to work.

-1

This problem must be occurring by conflict of some more javascript call, make a test, remove all and put the below:

<!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script>
  • Fabio, the ideal and that tests and doubts are suggested by comments

-2

Remove duplicate jQuery and/or Bootstrap loads. Inspect the code and locate the points where jQuery and/or Bootstrap loads occur more than once.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.