如何在一个文件中打印页面上的所有框架 [英] How to print all frames on the page in one file

查看:190
本文介绍了如何在一个文件中打印页面上的所有框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用frameset标签,我想打印框架集中的所有框架

<html>
     <frameset rows="10%,*">
       <frame name="top_frame" src="top-frame.htm" frameborder="1" noresize="0" scrolling="no">
       <frameset cols="20%,*">
          <frame name="left_frame" src="left-frame.htm" frameborder="0" noresize="0" scrolling="no">
          <frame name="right_frame" src="right-frame.htm" frameborder="0" noresize="0" scrolling="auto">
       </frameset>
    </frameset>
</html>

我使用了parent.window.focus();parent.print();,它可以在Chrome浏览器中使用,但是在IE11中,它可以将每个帧打印到一个文件中.

有什么建议吗?

我也使用了parent.window.focus();window.print();,但这两种都不起作用.

解决方案

这应该有效:

try{
    document.execCommand('print', false, null);
}
catch(e){
    window.print();
}

源链接

I am using frameset tag and i want to print all frames inside the frame set

<html>
     <frameset rows="10%,*">
       <frame name="top_frame" src="top-frame.htm" frameborder="1" noresize="0" scrolling="no">
       <frameset cols="20%,*">
          <frame name="left_frame" src="left-frame.htm" frameborder="0" noresize="0" scrolling="no">
          <frame name="right_frame" src="right-frame.htm" frameborder="0" noresize="0" scrolling="auto">
       </frameset>
    </frameset>
</html>

I used parent.window.focus();parent.print(); it works in Chrome, but in IE11 it prints each frame in one file.

any suggestion?

I also used parent.window.focus();window.print(); but it doesn't work in both.

解决方案

This should work:

try{
    document.execCommand('print', false, null);
}
catch(e){
    window.print();
}

Source link

这篇关于如何在一个文件中打印页面上的所有框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆