你在主窗口的keydown事件中调用document.frame.event是不是就行了

解决方案 »

  1.   

    top.frameA.focus();
    或在 FrameA 的页面里最后加上: window.focus()
      

  2.   

    1.htm
    <frameset rows="100,*">
    <frame src="2.htm"></frame>
    <frame src="3.htm" name=main></frame>
    </frameset2.htm:
    <body><a href="3.htm"  target="main" onclick="main.focus()">test</a>
    <a href="4.htm"  target="main" onclick="top.main.focus()">test</a>3.htm:
    <html>
    <head>
    <SCRIPT LANGUAGE=javascript>
    <!--
    function test(){
    alert(1);
    }//-->
    </SCRIPT>
    </head>
    <body onload="this.focus();document.body.onkeypress=test;">
    sssssssss
    </body>
    </html>
    4.htm:
    <html>
    <head>
    <SCRIPT LANGUAGE=javascript>
    <!--
    function test(){
    alert(2);
    }//-->
    </SCRIPT>
    </head>
    <body onload="this.focus();document.body.onkeypress=test;">
    sssssssss
    </body>
    </html>