0
我想打印iframe內容,我無法做到,我發現the url我是一個新的promgrammer,所以我不明白的問題和答案請解釋我幾個簡單的
謝謝提前我如何打印iframe內容
我想打印iframe內容,我無法做到,我發現the url我是一個新的promgrammer,所以我不明白的問題和答案請解釋我幾個簡單的
謝謝提前我如何打印iframe內容
這就是:
你的iframe:
<iframe id="printf" name="printf"></iframe>
印刷:
window.frames["printf"].focus();
window.frames["printf"].print();
BTW,嘗試以更好的方式下一次(發佈代碼可以幫助)來解釋你的問題=)
參考:Javascript Print iframe contents only
編輯:
作爲OP說沒有工作,我指的是測試頁鏈接在參考:
你也可以試試這個功能(參考文獻相同,不同的海報):
//id is the id of the iframe
function printFrame(id) {
var frm = document.getElementById(id).contentWindow;
frm.focus();// focus on contentWindow is needed on some ie versions
frm.print();
return false;
}
我都準備好了嘗試,但它並沒有幹活需要另一種解決方案 – 2014-09-05 10:16:16