Wenn ich versuche, meinen Code auszuführen, erhalte ich diesen Fehler: >
VM887: 1 Unkundungstypeerror: $ (...). Popover ist keine Funktion (…) < /p>
< /blockquote>
Hier ist mein Code: < /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>
Ich habe bereits viel gesucht, aber ich konnte für dieses Problem keine Lösung finden. < /p>
Freundliche Grüße, < /p>
Florian < /p>