图像不加载谷歌浏览器
问题描述:
我想准备一个印刷文件,我喜欢加载一个小徽标。图像在Mozilla Firefox和IE中加载正常,但不会在谷歌浏览器中加载。我不知道问题是什么。有什么建议么 ? 这里是我的代码的一部分:图像不加载谷歌浏览器
mywindow.document.write("<table border='solid gray 1px' style='text-align:center'>");
mywindow.document.write("<tr><td><img src='CSS/images/logosmall.jpg'></img><td><td> <span style='font-family:Tahoma'>HELLO</span></td></tr>");
mywindow.document.write("</body></html>");
mywindow.print();
mywindow.close();
答
尝试
var strHtml = "<table border='solid gray 1px' style='text-align:center'>";
strHtml += "<tr><td><img src='CSS/images/logosmall.jpg' /></td><td><span style='font-family:Tahoma'>HELLO</span></td></tr></table>";
strHtml += "</body></html>";
mywindow.document.write(strHtml);
mywindow.print();
mywindow.close()
+0
我也试过这个,但又没有结果。 –
+0
我已经试过这个,它的工作在Chrome版本27.0.1453.110米 请采取我的答案的最后编辑版本,并检查您的版本的铬 – Champ
+0
我的版本是一样的你的 –
''可以''我不是说是你的问题的原因。 –
我以前试过但没有结果。不管怎么说,还是要谢谢你。 –
你的html像img标签有问题,缺少td的结束标签。我已经更新了html,请参阅我的回答 – Champ