I have the following code:
// Creates a timer to check for elements popping into the dom
timer = setInterval(function ()
{
for (p i
$(document).ready() tells you when the dom is ready, but not all assets are necessarily done coming in.
If you want to make sure all the assets are actually done loading, use $(window).load() instead. The most common use for this is to make sure that images are done loading, but it may work for your script problem as well.