打印网页 [英] printing the webpage

查看:66
本文介绍了打印网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个HTML页面,它组成了几个框架。每个框架显示

一个不同的HTML页面。


当windows.print()时在特定的HTML框架页面中弹出一个

打印对话框弹出窗口,但它只能打印该特定

HTML框架页面中的内容。这与选择文件 - >打印

....不同。来自Internet Explorer。


我是否知道如何在

特定框架中弹出JavaScript调用的打印对话框,该框架可以打印整个内容HTML页面

(包括帧的内容)但不仅仅是特定帧的内容




谢谢。

There is a HTML page which composes several frames. Each frame displays
a different HTML page.

When "windows.print()" is invoked in a particular HTML frame page, a
print dialog pop-ups but it can print the contents in that particular
HTML frame page only. This is different from by selecting "File->Print
...." from Internet Explorer.

May I know how to pop-up a print dialog invoked by JavaScript in a
particular frame which can print all contents of the whole HTML page
(including the contents of the frames) but not only the contents of
that particular frame?

Thank you.

推荐答案

嗨!


您是否在调用javascript的javascript中尝试过这个打印?


//将焦点放在父框架上

MyParentFrame.focus()

//打印父框架。这应该打印所有内容

MyParentFrame.print()


您可以在
$ b中存储调用打印的框架的名称$ b变量然后在onafterprint

事件之后将焦点返回到该帧,以防你需要重点关注该帧。


HTH,M

Hi!

Have you tried this inside the javascript that invokes the print?

// Give focus to parent frame
MyParentFrame.focus()
// Print parent frame. That should print everything
MyParentFrame.print()

You may can store the name of the frame that invoked the print in a
variable and then return the focus to that frame after the onafterprint
event in case you need to have focus back on that frame.

HTH, M


嗨!


您是否在调用打印的javascript中尝试了这个?


//将焦点放在父框架上

MyParentFrame.focus()

//打印父框架。这应该打印所有内容

MyParentFrame.print()


您可以在
$ b中存储调用打印的框架的名称$ b变量然后在onafterprint

事件之后将焦点返回到该帧,以防你需要重点关注该帧。


HTH,M

Hi!

Have you tried this inside the javascript that invokes the print?

// Give focus to parent frame
MyParentFrame.focus()
// Print parent frame. That should print everything
MyParentFrame.print()

You may can store the name of the frame that invoked the print in a
variable and then return the focus to that frame after the onafterprint
event in case you need to have focus back on that frame.

HTH, M


嗨!


您是否在调用打印的javascript中尝试了这个?


//将焦点放在父框架上

MyParentFrame.focus()

//打印父框架。这应该打印所有内容

MyParentFrame.print()


您可以在
$ b中存储调用打印的框架的名称$ b变量然后在onafterprint

事件之后将焦点返回到该帧,以防你需要重点关注该帧。


HTH,M

Hi!

Have you tried this inside the javascript that invokes the print?

// Give focus to parent frame
MyParentFrame.focus()
// Print parent frame. That should print everything
MyParentFrame.print()

You may can store the name of the frame that invoked the print in a
variable and then return the focus to that frame after the onafterprint
event in case you need to have focus back on that frame.

HTH, M


这篇关于打印网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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