-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox 29 requests undefined
URL in case of lazy loading
#98
Comments
Hello @tokkonopapa, do you have any insight on how to fix this issue? Thank you :-) |
Hi @oncletom, getNaturalWidth = (function(){
if (Object.prototype.hasOwnProperty.call(document.createElement('img'), 'naturalWidth')) {
return function (image){ return image.naturalWidth;};
}
// IE8 and below lacks the naturalWidth property
return function (source){
var img = document.createElement('img');
img.src = source.src || "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
return img.width;
};
})(); When |
It means the naturalWidth is somewhat performed while the element is not yet replaced by an image in the DOM. I have seen such a similar error from time to time in the CI tests so I wonder if there is a ran-DOM race condition which would trigger your issue. |
Thank you for your information. In my experience, this can be found only in Firefox. So it seems not this project concern. Regardless of any reason, waste of HTTP request is not good for us. So I left the above temporal code for who are intersted in this topic. And I will entrust to you that this issue should be closed or still opened. Thanks again. |
#104 now creates placeholders when lazyload is on. So a naturalWidth should always be available. Let me know if you still encounter the issue when |
|
Thanks for your feedback @tokkonopapa 👍 |
When
lazyload
is set totrue
, Firefox 29 fails to getnaturalWidth
and requestsundefined
URL from fallback function for IE8.Please check http://jsfiddle.net/tokkonoPapa/ms3c6/ or http://contentloaded.com/responsive/bbc-news/ .
The text was updated successfully, but these errors were encountered: