Frameset列印frame的問題(downmoon)

來源:互聯網
上載者:User
問題:
位於同一個父頁面的兩個架構間,
比如有"RightWin"和"WorkWin"兩個架構,在"RightWin"裡有個按鈕print,要實現功能為列印WorkWin的頁面內容,我的語句是這麼寫的: function Print(){ window.parent.frames("WorkWin").window.print(); }
 但是結果卻是列印出了RightWin中的內容
解決方案:
FrameSet內容

<frameset cols="20%,*">
        <frame name="RightWin" src="RightWin.htm">
        <frame name="WorkWin" src="Workwin.htm">
    </frameset>

RightWin.htm內容:<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script language="javascript" type="text/javascript">
        function Print() {
            alert(window.parent.frames("WorkWin").name);
            //window.parent.frames("WorkWin").print();
            parent.WorkWin.focus()
            parent.WorkWin.print()   
        }
        </script>

</head>
<body>
    rightwin
    <input id="getPrint" type="button" value="Print" onclick="Print();" />
</body>
</html>

列印frame視窗要   先進行     frameName.focus();

另外注意路徑問題。而且印表機設定要"只列印當前架構"  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.