how to access the functions defined in scripts of URL loaded in iframe

how to access the functions defined in scripts of URL loaded in iframe

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 :

I have Sample.html :

  1. <html>
  2. <head><script type="javascript">
  3. function sumfunction(var i, var j)
  4. {
  5.       var k = i + j ;
  6.       alert("sum of the variebles : " + k);
  7. }
  8. </script></head>

Test.html  : This html file contains iframe with src=sample.html
 
  1. <script type="text/javascript" src="jquery-1.5.1.min.js"></script>
  2. <script type="text/javascript">
  3. $document.ready(fuction()) {
  4. var i=10;
  5. $('#frame1').ready(function()){
  6. // Need to access the function (sumfunction(10,20)) defined in scripts of Sample.html 
  7. of iframe (frame1) ??
  8. } </script><head>
  9. <body >
  10. <iframe id="frame1" src="sample.html" />
  11. <body>
In Above code of test.html , i want to access function(sumfunction(20,30)) 
defined in sample.html of iframe in test.html using jquery. 
    
Please suggest, how can i achieve this ?