lazyload
lazyload copied to clipboard
one more placeholder case for blank src attribute
In some templates, such as ERB for Rails, it will automatically generate a <img>
tag likes:
<img class="lazy" data-original="something.jpg" height="180" src="" width="180">
so the plugin will not work because the if
in https://github.com/tuupola/jquery_lazyload/blob/master/jquery.lazyload.js#L92
if ($self.attr("src") === undefined || $self.attr("src") === false) {
will always be false, and the placeholder will not be shown.
I append a new case which considers a blank src
attribute like ''
.