How do I call a nested function in a parent document from an iframe
<p>In parent:</p>

<pre><code>function outer(){
    function inner(){
        alert("hello");
    }
}
</code></pre>

<p>in iframe</p>

<pre><code>parent.outer.inner();
</code></pre>

<p>does not work.</p>

<p>Edit: So they are private. No problem. The reason for doing this is to try and hide these functions from global scope as much as possible. I thought putting them behind a single function name with a pretty unique name would be the best way to do this.</p>

<p>Essentially do I need to</p>

<p>parent:</p>

<pre><code>function outer(action){

    if(action == "inner")
       inner()

    function inner(){
        alert("hello");
    }
}
</code></pre>

<p>iframe:
    parent.outer("inner");</p>

<p>Is there a more elegant way of doing this?</p>
