title: Load replaceWith text change before page change
body: <p>hopefully a quick and easy one. I have a small sample of code (below) that when a class is found in the body, the page h1 title changes to another title. The project I'm working on needs lots of different templates, so I am using jquery to get this done. </p>
  
  <p>The following works: </p>
  
  <pre><code>$(function() {  
  if ($(".Class").length &gt; 0) {
        $self = $('.header &gt; h1')
        $self.replaceWith( "&lt;h1 class='classSomething'&gt;" + "New Header 
  Title" + "&lt;/h1&gt;" );
  }
  });
  </code></pre>
  
  <p>However, the page loads and then, the title changes which looks bad. Is there a way to make sure the title changes before we see any of the rendered page?</p>
  
  <p>just to mention, I've tried $(window).load(function.... and this also does the same thing. Maybe a quick pause to let everything load and then, the page shows? </p>