JQuery - Binding / Appending to document.ready
<p>I am working on a ASP.NET MVC 3 application that is using JQuery. In this application, I have my _Layout.cshtml file and MyView.cshtml. In _Layout.cshtml I have something like the following:</p>

<pre><code>&lt;div id="wrapper" style="background-color:Gray; height:100%;"&gt;
  &lt;div id="content" style="background-color:Silver;"&gt;
    @RenderBody()    
  &lt;/div&gt;
  &lt;div id="footer" style="background-color:Silver;"&gt;
    Footer
  &lt;/div&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
    // Do stuff
    alert("Root Loaded");
  });
&lt;/script&gt;
</code></pre>

<p>In MyView.cshtml, I have the following:</p>

<pre><code>&lt;div id="contentDiv"&gt;
  &lt;!-- Page content is here --&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
    $().ready(function () {
      alert("Page Loaded");
    });
&lt;/script&gt;
</code></pre>

<p>At this time, the "Page Loaded" message box appears before the "Root Loaded" message. I kind of understand why this is happening. However, I would like to write a method in MyView.cshtml that gets called after the root document.ready function is called. Am I making sense? Is there a way to do this? If so, how?</p>

<p>Thank you</p>
