I'm using Mutation Summary library to observe when a particular type of elements have been added and then append each of them with my html element:
var observer = new MutationSummary({
callback: theNextPageLoaded,
queries: [{
element: "li.sweet"
}]
});
function theNextPageLoaded(summaries) {
var sc = summaries[0],
sc_length = sc.added.length,
btn = $('<button>', {
class: 'my_btn',
text: 'Please work!'
});
sc.added.forEach(function(newEl) {
newEl.appendChild(btn);
console.log(typeof(newEl)); //newEl's type is 'object'
});
}
Code above is not working. I'm not sure I can even use appendChild on an object. Any help would be appreaciated!
Sorted. btn is a jquery object. so i had to convert .get(0) to get dom format.
--
You received this message because you are subscribed to the Google Groups "mutation-summary-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mutation-summary-d...@googlegroups.com.
To post to this group, send email to mutation-sum...@googlegroups.com.
Visit this group at http://groups.google.com/group/mutation-summary-discuss.
For more options, visit https://groups.google.com/d/optout.