$ ("a [rel = popover]"). popover is not a function

I call the jsfiles for the library bootstrap twitter, but I get an error

$("a[rel=popover]").popover is not a function

.

<script src="../../jq/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../bootstrap/js/bootstrap.js" type="text/javascript"></script>
<script src="../../bootstrap/js/bootstrap-tooltip.js" type="text/javascript"></script>
<script src="../../bootstrap/js/bootstrap-popover.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {

        // second supervisor popover
        $('a[rel=popover]').popover({
            placement: 'below',
            offset: 20,
            trigger: 'manual'
        });
    });


</script>
+3
source share
2 answers

It works:

http://jsfiddle.net/9W53Q/7/

Edit: http://jsfiddle.net/9W53Q/272/

Make sure the resources are added in the correct order (hint first). Or, as Richard Dalton (and I recommend) suggested, just use the compiled bootstrap.js file.

$(document).ready(function() {
    $('a[rel=popover]').popover();
});
+1
source

This happened to me in ASP.NET MVC 4. In my project, I had

@Scripts.Render("~/bundles/jquery")

<head>, @Scripts.Render("~/bundles/jquery") </body>. , .

, <head> :

<script src="/Scripts/jquery-1.9.1.js">
<script src="/twitterBootstrap/js/bootstrap.js">
<script src="/Scripts/modernizr-2.5.3.js">

,

<script src="/Scripts/jquery-1.9.1.js">

. , .

+2

All Articles