that stems from a null object when we try to access teh closest elements of the toggler object.
$(toggler).closest("div.comment").children("div.earmark"): TypeError: Cannot call method 'closest' of null
that object happens to be a reference to the ANSWER THIS / HIDE THIS a href on each questions.
I've stared at this for probably an hour and I can't figure out what the issue is, since ultimately the code works (answers expand and hide when we click these links).
It's a problem because it causes the Timeline to fail to load and breaks the reporter views. It's only a problem when we click on the big green Answer This button on the front page (presumably because we try and use these methods while some of the page hasn't loaded in that instance).
When trying to expand and hide answer forms, we eventually come to this function.
function earmarkrefresh(toggler) { var newheight = $(toggler).closest("div.comment").height(); var newhalfheight = (newheight / 2); // alert(newheight); $(toggler).closest("div.comment").children("div.earmark").height(newheight); $(toggler).closest("li").children("div.aflag").height(newhalfheight).css("top",newhalfheight+"px"); }
It throws an error on
$(toggler).closest("div.comment").children("div.earmark").height(newheight);
saying
Uncaught Dimensions: jQuery collection is empty
that stems from a null object when we try to access teh closest elements of the toggler object.
$(toggler).closest("div.comment").children("div.earmark"): TypeError: Cannot call method 'closest' of null
that object happens to be a reference to the ANSWER THIS / HIDE THIS a href on each questions.
I've stared at this for probably an hour and I can't figure out what the issue is, since ultimately the code works (answers expand and hide when we click these links).
It's a problem because it causes the Timeline to fail to load and breaks the reporter views. It's only a problem when we click on the big green Answer This button on the front page (presumably because we try and use these methods while some of the page hasn't loaded in that instance).