如果在parent.html中是使用window.open('son.html')打开子页面, 
那么在son.html中调用: window.opener.a();

解决方案 »

  1.   

    尝试一下,把这个去掉:【void(0)】,看代码吧
    test.html
    <body bgcolor=black>
    <a href="javascript:top.a(self)">dfeokrfep</a>
    </body>parent.html
    <script>
    function a(ifa)
    {
    //alert(ifa);
        ifa.location.href="http://www.google.com";
    }
    </script>
    <body>
    <iframe id="main" src="test.html"></iframe>
    <br>
    <a href="javascript:a(main)">dfeokrfep</a>
    </body>经过测试,成功,呵呵
      

  2.   

    把函数移动到子页面。
    parent.html 
    <body>
    <iframe name="main" src="test.html"></iframe>
    </body>test.html<script>
    function a()
    {
        self.parent.window.frames["main"].location.href="http://www.google.com"
    }
    </script><a href="javascript:void(0)" onclick="a()">dfeokrfep</a>
      

  3.   

    <iframe name="main" src="test.html"></iframe>
    ------------------
    test.html 是son.html吧。