cbreemer
King Coder
I have a strange issue with Chrome.
When I create a window with html that contains an image, the image is displayed ok. But then if I do
The used image is attached. I guess what I need is a way to tell the window, or its document, to (re)load external content like images, as it's evidently not doing it by itself. But I can't find anything to that effect. Any ideas much appreciated.
When I create a window with html that contains an image, the image is displayed ok. But then if I do
window.print()
the image disappears from the new window, and consequently is not printed. Note, this only happens when my CacheKiller extension is active. Of course I don't normally have Cache Killer running, so it's not much of a problem, but I'd like to understand this. My complete code :
HTML:
<html>
<head>
<script>
const inner=`<html>
<div style='border:3px blue solid;width:300px' >
<img src='edward.jpg' style='width:100%'>
<div style='font-size:32px;color:red;'>Nice !!</div>
</div></body></html>`;
function test(print)
{
var w = window.open("", "Print", "width=800,height=800");
w.document.write(inner);
if (print)
window.print();
}
</script>
</head>
<body onload="divleft.innerHTML = inner;">
<div id="divleft" ></div><br>
<button onclick="test(false)" >Test</button>
<button onclick="test(true)" >Test with print</button>
</body>
</html>
The used image is attached. I guess what I need is a way to tell the window, or its document, to (re)load external content like images, as it's evidently not doing it by itself. But I can't find anything to that effect. Any ideas much appreciated.