how to access the functions defined in scripts of url loaded in iframe?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1952359/calling-iframe-function">calling iframe function</a>  </p>
</blockquote>



<p>Hi All,
How to access the functions defined in scripts of URL loaded in iframe using jquery ? Following is the much more elaboration of question :</p>

<p><strong>I have Sample.html :</strong></p>

<pre><code>&lt;html&gt;
&lt;head&gt;&lt;script type="javascript"&gt;
function sumfunction(var i, var j)
{
      var k = i + j ;
      alert("sum of the variebles : " + k);
}
&lt;/script&gt;&lt;/head&gt;
</code></pre>

<p><strong>Test.html  : This html file contains iframe with src=sample.html</strong></p>

<pre><code>&lt;script type="text/javascript" src="jquery-1.5.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$document.ready(fuction()) {
var i=10; 
$('#frame1').ready(function()){
// Need to access the function (sumfunction(10,20)) defined 
// in scripts of Sample.html of iframe (frame1) ??
} &lt;/script&gt;&lt;head&gt;
&lt;body &gt;
 &lt;iframe id="frame1" src="sample.html" /&gt;
&lt;body&gt;
</code></pre>

<p><strong>In Above code of test.html , i want to access function(sumfunction(20,30)) 
defined in sample.html of iframe from test.html using jquery. 
Please suggest, how can i achieve this ?</strong></p>
