如何打印iframe的内容? [英] How to print content of iframe?

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

问题描述

我在用户控件中有一个iframe,例如

I have an iframe in user control like,

<iframe id="PrnFrame" runat ="server"   src="Dummy.aspx">
    <div id="prn"></div>
    </iframe>


并且Dummy.aspx还包含ID为prnDIV的div.
我正在通过javascript之类的
访问div的内容


and Dummy.aspx also contains div with id prnDIV .
I am accessing contents of div through javascript like

document.getElementById('<%=this.ClientID%>' + '_PrnFrame').contentWindow.prnDIV.outerHTML

推荐答案

检查以下链接:

http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=449

http://stackoverflow.com/questions/831147/从父窗口动态创建iframe的打印内容
http://stackoverflow.com/questions/472951/how-do-i-print-an-iframe-from-javascript-in-safari-chrome
http://www.webmasterworld.com/forum91/4086.htm
Check following links :

http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=449

http://stackoverflow.com/questions/831147/printing-contents-of-a-dynamically-created-iframe-from-parent-window
http://stackoverflow.com/questions/472951/how-do-i-print-an-iframe-from-javascript-in-safari-chrome
http://www.webmasterworld.com/forum91/4086.htm


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

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