我想通過使用以下代碼通過javascript打印div標籤內容。如何通過javascript打印沒有url和datetime的文件
var divToPrint1 = $('#PrintDoc').html();
var newWin = window.open('Share Certificate #001', '', 'width=10px,height=10px');
newWin.document.open();
newWin.document.write('<html><body onload="window.print();">' + divToPrint1 + '</body></html>');
newWin.document.close();
setTimeout(function() { newWin.close(); }, 10);
並且打印代碼工作正常。但現在我想通過使用JavaScript代碼從打印頁面中刪除網址,日期和標題。
可能嗎? 你能幫我解決下面的代碼嗎?
什麼約會?時間?網址是什麼?你能更具體一點嗎? – Blender 2011-03-19 04:53:29
就我所知,完全取決於瀏覽器,據我所知,不存在用於控制該API的標準API。 – some 2011-03-19 04:57:26