不行呀,打印的是下面的frame里的button

解决方案 »

  1.   

    下面frame的button 的onclick="topFrameName.print()"就可以啊
      

  2.   

    main.htm
    ===============<html>
    <frameset rows="100,*">
    <frame name="Wintop" src="11.htm">
    <frame src="2.htm">
    </frameset>
    </html>11.htm
    =================
    <html>
    <body>
    测试
    </body>
    </html>2.htm
    ============
    <html>
    <head>
    <script>
    function test(){
    parent.Wintop.focus()
    parent.Wintop.print()
    }
    </script>
    </head>
    <body>
    <input type=button onclick="test()" value="打印">
    </body>
    </html>
      

  3.   

    多谢net_lover老兄。
    分就给你了。