gpt4 book ai didi

javascript - chrome 不在动态创建的新窗口中显示图像

转载 作者:行者123 更新时间:2023-11-28 08:45:38 25 4
gpt4 key购买 nike

我正在使用 javascript 创建一个新窗口并显示服务器上存在的图像。该窗口可以正常打开并在 Firefox 上显示图像,但在 Chrome 上则不显示。可能出了什么问题?

function wopen(){
nwin = window.open('','_blank','directories=no,height=600,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=800,top=10,left=60');
nwin.document.open();
var msg = "<html><head><title>Test page</title></head><body><img src='http://www.mywebsite.com/images/logo.jpg' border='0' height='20' width='20'></body></html>"
nwin.document.write(msg);
nwin.document.close();
}

当我调用此函数时,窗口打开,但图像未在 chrome 中显示,但在 Firefox 中正确显示。这里有什么问题吗?

最佳答案

在我更改网络托管服务器中的设置后,此问题得到解决;我所做的就是取消之前处于事件状态的图像盗链。

关于javascript - chrome 不在动态创建的新窗口中显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19843774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com