Changing execution context from parent to child frame
<p>I'm not even sure if this is possible, but is there anyway to set an execution context beyond setting the value for "this"?</p>

<p>The case I am primarily referring to is executing code from one frame in the context of another frame, so that when I access global objects (ex: window, document...) from a function that was defined in frame1, It will be executed in the frame2 environment.</p>

<p>If this is not possible, what are some workarounds? Please don't say "just define the function in the child frame", I'm dealing with a larger application framework, and it would be both pointless and memory inefficient if I had to load up two instances of the entire framework.</p>

<p>EDIT: Here is some code which should demonstrate what I am trying to do. When run, it should  show an alert that, if a solution is found, displays "iframe.html" at the end of the location string.</p>

<pre><code>&lt;script&gt;

function run() {
go.call(window.iframe);
}

function go() {
alert(window.location);
}
&lt;/script&gt;
&lt;iframe src="iframe.html" name="iframe" onload="run()"&gt;
</code></pre>

<p>Thanks.</p>
