【发布时间】:2014-01-24 18:56:27
【问题描述】:
我正在使用谷歌文档查看器来显示我上传的文档并且我想打印它,但我无法使用 jQuery 打印这些文档。
我想打印 iframe 文档,但不是我的代码。怎么打印那个文件??
<button id="printbtn" onclick="myFunction()">Print</button>
<iframe src="http://docs.google.com/viewer?url=<?php echo urlencode(UPLOAD_URL.$file_name); ?>&embedded=true" frameborder="0" scrolling="no" id="iframe" style="border: none;" width="800" height="470"></iframe>
<script>
function myFunction(){
window.frames["iframe"].focus();
window.frames["iframe"].print(); // NOT WORKING
}
</script>
请帮帮我……
【问题讨论】:
-
我不确定,但这是同样的问题:Duplicate?
-
在这个问题中显示其他网站的 html 在我的问题中我有打开的 word 或 pdf 文件。
-
你是用wordpress还是别的?
标签: javascript php jquery html iframe