我想通过使用以下代码通过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