qwery
qwery copied to clipboard
DOM Exception 12 on append inside each loop
$(".block--discussion-thread").each(function(el) {
if (!$(this).hasClass("block--discussion-thread--checked")) {
if (typeof $(this)[0].children[4] !== "undefined") {
var blockID = "#" + $(this)[0].children[3].id;
var numOfComments = $(this)[0].children.length - 4;
if (numOfComments == 1) {
$(this).addClass("block--discussion-thread--orphan");
} else {
$(blockID).append("<div class='more more--comments'><span class='more__label' data-icon=''>" + numOfComments + " more replies</span></div>");
}
}
}
$(this).addClass("block--discussion-thread--checked");
});
This piece of code fails with a DOM exception 12 error on the line starting $(blockID).append
Console error references line 88 in Qwery 4.0, reverting to older 3.x version fixes this.