Best way to propagate opener variable across page navigation?
<p>Application that I'm working on has multiple modules. Two are of a concern - main module and module that I write. And I have to call a function on window that contains main module and the problem is that I have to call that function not from page that is opened by parent webmodule, but from page to which user navigates from this page. </p>

<p>Basically first page presents just some query forms, lets user to make some query, and second holds query results, and I am supposed to update contents of parent page based on these results. </p>

<p>Navigation goes like that</p>

<ul>
<li>Main module </li>
<li>First page of my module (i have main module page as an <code>window.opener</code> variable. </li>
<li>Second page of my module (and I would like to be able to open this page in the same browser window that the first one is opened)</li>
</ul>

<p>And I would like to have as free navigation as possible - like opening query results in new tab, going back changing query parameters, making new query, etc. I would also like to present user query forms on page that displays results and let them to refine this query, and still be able to update main module. </p>

<p>I was thinking of following solutions: </p>

<ol>
<li>Using AJAX to load query results to first window, but I would like to have this app as simple as possible, and AJAX is not simple ;)</li>
<li>Spawning new window on every request and doing code like <code>var mainModule = opener.mainModule</code>. Which is evil. </li>
<li>Embedding query results in a frame or iframe, but I havn'e got the slightest idea on how to inject main module window javascript variable into frame or iframe.</li>
</ol>
