Search code examples
javascriptiosmootools

How to fix TypeError: 'null' is not an object (evaluating 'e.parentNode')


when I try to send a message to the server I receive an error in the console, please help to solve this problem console sand me mootools-core-1.4.5.js

after: function(l, e) { var D = e.parentNode; if (D) { D.insertBefore(l, e.nextSibling); }

mine code here


Solution

  • Saw your code, in the inject part the element passed is incorrect It is carrying double $$ instead of single.

    Your Code:

      ).inject($$('div.comment').getLast(), 'after');
    

    Should be

       ).inject($('div.comment').getLast(), 'after');