Trigger "second" document ready from a partial view
<p>Let's say I have SiteA and SiteB. </p>

<p>I am trying to load a partial view from SiteB into a dialog in SiteA .</p>

<p>Like this:</p>

<pre><code>//This is done SiteA 
$("#selector").load("SiteB/View");
</code></pre>

<p>doc ready of SiteB/View:</p>

<pre><code>//This is done SiteB 
 $(document).ready(function () {

    home.redirectUrl = 'www.url.com';
    home.initializePage('data');
    home.initializeEvents();

});
</code></pre>

<p>Home is initialized on a script referenced above that code. But it seems that it will try the code inside the document ready before the referenced script loads properly so I get that home is 'undefined'. So it does not behave as a "second" document ready.</p>

<p>So i need to find a way to actually make it behave as such or is it another way around this problem ?</p>

<p>Also if I access SiteB/View by it's self on the browser it works fine.</p>