title: $(document).ready(function() with Meteor JS templates
body: <p>I have a template I've deeply integrated with Meteor. It uses a scripts.js file that runs a bunch of commands after $(document).ready and $(window).load.</p>
  
  <p>I put scripts.js inside of client/compatibility, and it works only if I do a hard refresh of the template. Otherwise, the template doesn't render and the functions don't execute.</p>
  
  <p>Specifically, this code:</p>
  
  <pre><code>    // Append .background-image-holder &lt;img&gt;'s as CSS backgrounds
  
  $('.background-image-holder').each(function() {
      var imgSrc = $(this).children('img').attr('src');
      $(this).css('background', 'url("' + imgSrc + '")');
      $(this).children('img').hide();
      $(this).css('background-position', 'initial');
  });
  </code></pre>
  
  <p>Much appreciated if you know how I should take it from here.</p>