Inherit parent frame's jQuery object including plugins
<p>I have a frame B which is a child of A:</p>

<pre><code>A
|_B
</code></pre>

<p>The page loaded by B can (will) change, and I used multiple jQuery plugins in my app. Is there a way I can include jQuery and all those plugins in A and just inherit the whole jQuery (which will have the plugins) object in every page in B so that everything works just like if I had included everything in B again? This code doesn't work as expected (being included in B):</p>

<pre><code>window.$ = function(){ 
    var args = Array.prototype.slice.call(arguments); 
        args.push( window.document );
        return top.window.jQuery.apply( top.window.$, args ); 
};
</code></pre>

<p>Basically, the idea is to include jQuery and plugins in A, then work in B using normal jQuery syntax, in the context of B's <code>document</code>.</p>

<p>Edit: Just for clarification, I <em>have</em> access to the pages loaded by B, and can execute any code I want.</p>
