question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Popover is not a function

See original GitHub issue

Hello version v5.0.0-alpha3 have problem with popover. It display this error: Uncaught TypeError: $(…).popover is not a function - on line 15 ($(“.pop”).popover({)

Here is the complete HTML:

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Popover</title>
  <link rel='stylesheet' href='css/bootstrap.min.css'>
  <script src='js/jquery.min.js'></script>
  <script src='js/bootstrap.bundle.min.js'></script>
</head>
<body>
  
  <button type="button" class="btn btn-info pop" data-container="body" data-placement="right" >HOVER OVER ME... </button>

  <script>
    $(".pop").popover({
      trigger: "manual",
      content: function() {
        var data = ''+
          '<ul class="list-group" style="font-size:16px;">'+
            '<a href="#" class="list-group-item list-group-item-action xxx" >xxxxxDin</a>'+
            '<a href="#" class="list-group-item list-group-item-action xxx" >Morbi leo risus</a>'+
            '<a href="#" class="list-group-item list-group-item-action xxxy" >Porta ac consectetur ac</a>'+
          '</ul>';
        return data;
      },
      html: true,
      sanitize: false,
      animation: true
    }).on("mouseenter", function() {
      var _this = this;
      $(this).popover("show");
    }).on("mouseleave", function() {
    })  
  </script>
</body>
</html

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
tidusIOcommented, Nov 12, 2020

Probably it’s because it’s async. We’re waiting for DomContentLoaded now to extend jQuery. It could be, that the script is executed before DomContentLoaded. It should work, if you wrap your code with

$(function() {
  // Handler for .ready() called.
});
0reactions
schappaughccommented, Jan 14, 2022

doesn’t work

Read more comments on GitHub >

github_iconTop Results From Across the Web

$(...).popover is not a function - Stack Overflow
Sometimes (always) the web page doesn't fully render the content and the POPOVER will gives this error. So, We need 500ms delay starting...
Read more >
popover is not a function error - Open Tech Guides
I have a form that use popovers.. and i have the following code inside document ready $(document).ready(function() { $('[data-toggle="popover"]').popover(); });.
Read more >
$j(...).popover is not a function" error thrown in browser console
It is generally caused by creation of global UI Scripts with conflicting versions of jQuery. When included in pages via making the UI...
Read more >
Popovers - Bootstrap
Triggering popovers on hidden elements will not work. Popovers for .disabled or disabled elements must be triggered on a wrapper element.
Read more >
jQuery error - Laracasts
The jquery click event is not working. The console says "Uncaught TypeError: $(...).popover is not a function." Copy Code
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found