Board Thread:Support Requests - Getting Technical/@comment-3279487-20131010150350/@comment-957747-20131011215750

As Bobogoobo and Penguin-Pal stated, timers are not the best solution here.

"Disclaimer: these modules are allowed only if they are not excessive or breaks any other functionality. If we find that the new modules overly push down or break ads and/or ad placement within the rail, they will have to be changed/removed. If they do become excessive, they will also need to be removed. We prefer (but don't insist) that custom modules go below the default modules. No module can ever be placed above the top ad."

"Also, keep in mind that these modules are discouraged as this area is technically an official area of the skin. These modules can break at any time and that is the risk that you take by using any custom code on your site."

Now that that's out of the way, let me introduce DOMNodeInserted. DOMNodeInserted is a bind function that triggers when a node is inserted into the DOM. This is a way to tell when the rail loads without the need for a timer.

The above code will only fire when a node is inserted into the WikiaRail ID. In essence, this adds a listener and fires when the rail loads and runs the code specified.

'''Please note that unless you add a test to see if your node is added before you add one or unbind the listener after you have. Since this is code that triggers when a node is added, adding your node will trigger it again and end in an infinite loop.'''

For example: