Когда я пытаюсь запустить свой код, я получаю эту ошибку: < /p>
vm887: 1 uncaught typeerr: $ (...). Popover не является функцией (…) < /p>
Вот мой код: < /p>
$('head').append('\
');
$(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(
"$(function(){$('[data-toggle=\"popover\"]').popover();});\
"
);
});
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 = '\

\
';
// console.log("Replacing HTML");
$(context).html(body.replace(word, word + " " + image));
counter.i++;
}
}
}
< /code>
Я уже много искал, но я не смог найти какое -либо исправление для этого вопроса.>
Подробнее здесь: https://stackoverflow.com/questions/402 ... a-function