开发者

javascript image onError in case of non 200 response

I have to count image 开发者_如何学运维loading time. onLoadHandler is responsible for it.

<img onError="onErrorHandler(this);" onLoad="onLoadHandler(this);" alt="" border='0' width='1' height='1'   src='http://exmaple.com/02.jpg'/>

It is works fine if image is normal file with 200 server response.

But partners provide chain of 302 redirects, and onError fires on first redirect. So i never get real loading image time.

Is there some workaround?

Thanks


Is the size of the image that you're redirected to the same size as the image you requested? If not, you can use this to detect an error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜