图片不加载在谷歌浏览器

image not loading in google chrome

本文关键字:谷歌浏览器 加载      更新时间:2023-09-26

我想准备一个打印文档,我喜欢在上面加载一个小标志。该图像在Mozilla Firefox和IE中加载良好,但在google chrome中加载不了。我不知道问题出在哪里。有什么建议吗?下面是我的一部分代码:

 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();

Try

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()