Hi I have a Chrome Extension that appends buttons to a Youtube page when the page loads. However, the buttons are not being appended even though I am using the jQuery append() function. The createButton() function also uses the append method. Is this a problem with the Chrome extension, or with how I am using jQuery?
Here is the code in question.
// On page load, add all buttons
function display() {
var r = $('<div style="float: left"><input type="button" value=Add ></div>');
r.click(function() {
buttonAdd();
});
$("#watch-headline-title").append(r);
var site = document.URL;
timearray = JSON.parse(localStorage.getItem(site));
if (timearray != null) {
timearray = timearray.sort(compStr);
for (i = 0; i < timearray.length; i++) {
if (! $( "#" + timearray[i]).length ) {
createButton(timearray[i]);
}
}
}
}
$( document ).ready(function() {
display();
});