Javascript 打印按钮不打印图像,但打印文本文档
我使用下面的java脚本打印按钮Javascript 打印按钮不打印图像,但打印文本文档,javascript,asp.net,Javascript,Asp.net,我使用下面的java脚本打印按钮 <script type="text/javascript"> function printform() { var printContent = document.getElementById('<%= Panel1.ClientID %>'); var windowUrl = 'about:blank'; var uniqueName = new D
<script type="text/javascript">
function printform()
{
var printContent = document.getElementById('<%= Panel1.ClientID %>');
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
</script>
函数printform()
{
var printContent=document.getElementById(“”);
var windowUrl='about:blank';
var uniqueName=新日期();
var windowName='Print'+uniqueName.getTime();
var printWindow=window.open(windowUrl,windowName,'左=50000,顶=50000,宽=0,高=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
上面的代码不是打印图像,而是打印文本文档。我能做些什么来解决这个问题。请提供解决方案。如果您发现很难看到要打印到文档上的背景图像,请确保在IE中设置了此选项(如果您使用IE)
图像可能是图像标签或背景图像?查看打印样式表,没有理由打开新窗口进行打印。请检查: