如何使用window.print()打印网页? [英] how to print a web page using window.print() ?

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

问题描述

朋友,我有一个网页,其中包含一个html文件,如图所示. .

hi friends , I have a web page which contain one html file included as shown . .

<td>
                <div class="abcd">
                </div>
                <!--#include file="../includes/abc.htm" -->
            </td>



以及一张具有javascript功能的印刷图片:javascript:Window.print().
它向我展示了打印预览中的所有内容,但其中包括html ..
请帮我...该怎么办..



and one image of print having a javascript function as : javascript:Window.print().
It show me aal part in print preview except that included html ..
Please help me ... What to do..??

推荐答案



您可以尝试下面的代码吗?

Hi,

Can you please try the below code.


< asp:button onclick ="myFunction()" xmlns:asp =#unknown">打印此页

<asp:button onclick="myFunction()" xmlns:asp="#unknown">Print this page



函数myFunction(){
window.print();
}


希望对您有所帮助.

问候,
Praneet



function myFunction() {
window.print();
}


Hope it helps.

Regards,
Praneet


为此,我包括css并使用它使其可见并起作用...
for this i include css and use make it visible and it work...


这篇关于如何使用window.print()打印网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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