Thread:SamwiseFilmore/@comment-30539549-20170104190534/@comment-25101690-20170123215124

The code loops through all elements with the class "MiniEditorWrapper" (Wikia uses this class around all editors), wherever they are in the page, then tries to find children (recursively, multiple levels, other elements between are ignored) with the classes "replyButton" (answering to threads), "submit" (posting a page comment), or the ID "WallMessageSubmit" (Posting a new WallMessage thread). These buttons are used to send the message. The code registers a click event on all these buttons that navigates to the actual editor content (which is identified by the class "bodyContent" inside an iframe) and adds the signature code right when the user clicks the button. An iframe is basically a complete website that is rendered as part of another website. Wikia uses iframes to load their editors dynamically.

I hope this explanation can help you with the debugging. Another thing: JS executes all code UNTIL it encounters an error, so all previous code is executed normally. To make sure the code is all executed, place the "display" code at the end. You can also add some code (eg an alert) at the end of the click event function to make sure that runs too. If it doesn't ove it up step for step to find the cause of the error.