jQuery: How do I stop the page being displayed until it's been processed?
<p>I'm using jQuery to modify the style of some pages in a large set of existing Web pages. This works, but the problem I have is that, for longer pages, the page is briefly visible with the wrong styles before the javascript kicks in and transforms the page.</p>

<p>I'm using this kind of thing (the alerts are just to emphasize the problem):</p>

<pre>$(document).ready(function(){
   ...
   alert("at this point the page is visible unstyled");
   $('body').addClass('myStyle');
   alert("now page looks like I want it to");
   ...
}</pre>

<p>How do I prevent the browser from displaying the page until <strong>$(document).ready(function()</strong> completes?</p>

<hr>

<p>EDIT <br>
Note: I can't change the HTML of the pages (they're not mine). All I can do is swap in a replacement JavaScript file and work with what's already in the HTML</p>
