Failed to execute 'removeChild' on 'Node'

前端 未结 10 1256
一向
一向 2020-12-01 01:40

I\'m using http://alexgorbatchev.com/SyntaxHighlighter/ to highlight code on my website but sometimes in my log im getting Javascript errors like this :

10条回答
  •  旧巷少年郎
    2020-12-01 02:22

    you need to check each time the method is executed whether the element is a child of the given parent.

    if(box.parentElement === parentBox) {
        parentBox.removeChild(box);
    }
    

提交回复
热议问题