如何检查图像是否正在预加载?(How to check if images are being preloaded?)
我想用javascript预加载图像,下面的方法似乎很简单,但我如何检查图像是否已预加载? 谢谢使用jQuery预加载图像
I want to preload an image with javascript, the method below seems simple enough but how can I check if the image has preloaded? Thanks Preloading images with jQuery
最满意答案
我建议修改代码,将'onerror'事件处理程序添加到您正在生成的img标记中。 然后处理任何失败。
http://www.w3schools.com/jsref/event_onerror.asp
I would suggest modifying the code to add on 'onerror' event handler to the img tags you are generating. and then handle any failures.
http://www.w3schools.com/jsref/event_onerror.asp
更多推荐
发布评论