简体   繁体   English

JavaScript图像预加载和403错误

[英]JavaScript image preloading and 403 error

I'm preloading Images using Javascript. 我正在使用Javascript预加载图片。 Some of them returns with error. 其中一些返回错误。

How can I know in code which error it is? 我如何在代码中知道是什么错误? 404/403? 404/403? onerror (evt) doesn't provide one - or I just don't know where to look. onerror (evt)不提供-或我只是不知道在哪里看。

thanks. 谢谢。

UPDATE 更新

I know that I can use FireBug / WebInspector... I need to decide dynamically, via code, which image to put on screen instead of erroneous one: "Image not found" or "Prohibited" or sth. 我知道我可以使用FireBug / WebInspector ...我需要通过代码动态决定要在屏幕上显示的图像,而不是错误的图像:“未找到图像”或“禁止”或其他。

Install a firebug (mozilla plug-in) and check the net tab. 安装Firebug(mozilla插件)​​并检查“ net”标签。 Click on a request and the on response tab. 单击一个请求,然后单击“响应”选项卡。

Chrome还内置了调试此类功能的功能-它位于工具/ developertools下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM