title: Bootstrap popover is not a function
body: <p>I am currently trying to develop a Chrome plugin that spots occurrences of different names inside each visited web page.</p>
  
  <p>When the plugin finds a name, it basically adds an icon next to it. When clicked, a bootstrap popover should appear with more information about the person.</p>
  
  <p>When I try to run my code, I get this error:</p>
  
  <blockquote>
    <p>VM887:1 Uncaught TypeError: $(...).popover is not a function(…)</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>$('head').append('&lt;script async src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js"&gt;&lt;/script&gt;\
  &lt;script async src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;');
  
  $(document).ready(function(){
    var name = "Nicolas";
    // console.log('Document is ready.. scanning for politicians...');
    //var hashmap = db_reader.getHashMap();
  
    var counter = {i: 0}; //Occurences. Singleton to be passed by reference and not by value.
    $('p').each(function(index) {
      addImage(this, counter);
    });
  
    $('li').each(function(index) {
      addImage(this, counter)
    });
  
    $('head').append(
      "&lt;script&gt;$(function(){$('[data-toggle=\"popover\"]').popover();});\
  &lt;/script&gt;"
    );
  
  });
  
  function addImage(context, counter) {
    var body = $(context).text();
    var word;
    var reg = /[A-Z]+[a-z]*/gm;
    while(word = reg.exec(body)){
      // console.log("while");
      if(word == name){
        // console.log(word);
        var image = '&lt;a href="#" data-toggle="popover" title="Popover Header" data-content="A wonderful content" id="popover'+counter.i+'" class="politicianFind"&gt;\
  &lt;img alt="name" src="https://s15.postimg.org/pei4ci3fv/fdp.png"&gt;\
  &lt;/a&gt;';
        // console.log("Replacing HTML");
        $(context).html(body.replace(word, word + " " + image));
        counter.i++;
      }
    }
  }
  </code></pre>
  
  <p>I have already searched a lot but I wasn't able to find any fix for this issue.</p>
  
  <p>Kind regards,</p>
  
  <p>Florian  </p>