call iframe function from parent window
<p>How to call a javascript function in ifram from parent window. 
i have a jsp page which contains an iframe. 
jsp page is served by "a.yenama.net" server and iframe is served "b.yenama.net" server.</p>

<pre><code>&lt;iframe width="1200" height="640" name="data" id="dataId" &gt;
&lt;/iframe&gt;   
&lt;br/&gt;
&lt;input type="button" name="data" value="Save data" onclick="callSaveData();" /&gt;
</code></pre>

<p>tried below code from parent jsp page and recieved permission denied error in IE</p>

<pre><code>window.frames['data'].callData();
</code></pre>

<p>also tried</p>

<pre><code>document.getElementById('dataId').contentWindow.callData(); //didn't work
</code></pre>

<h2>Function in iframe</h2>

<pre><code>window.callData = function(){
   alert('Iframe function');
}
</code></pre>

<p>your help is truly appreciated.</p>
