Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM Exception 12 on append inside each loop #98

Open
sammorrisdesign-zz opened this issue Jul 1, 2014 · 0 comments
Open

DOM Exception 12 on append inside each loop #98

sammorrisdesign-zz opened this issue Jul 1, 2014 · 0 comments

Comments

@sammorrisdesign-zz
Copy link

                    $(".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='&#xe050;'>" + 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant