本帖最后由 xiaoyao_studio 于 2012-03-29 16:19:46 编辑

解决方案 »

  1.   

    $("#mainfrm")[0].contentWindow.test();
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script src="http://code.jquery.com/jquery-latest.js"></script> 
        <script>
            $(function () {
                $("#btn").click(function () {
                    $("#mainfrm")[0].contentWindow.test();
                });
            });
        </script>
    </head>
    <body>
    <iframe src="ifm.htm" id="mainfrm"></iframe>
    <button onclick="" id="btn" ></button></body>
    </html>