lazyload icon indicating copy to clipboard operation
lazyload copied to clipboard

one more placeholder case for blank src attribute

Open Martin91 opened this issue 10 years ago • 0 comments

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 ''.

Martin91 avatar Apr 14 '14 07:04 Martin91