Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Lazyload: How to deal with internet connection lost?

Im using Lazysizes and trying to do something if user lose internet connection and keep scrolling, then there is no image shown How can i make if images are failed to donwload to replace them with src image? i tried to put in src loading image and replace on error but is not working because it return error again and again ...

document.addEventListener('error', function(e){ if(e.target.nodeName == 'IMG'){e.target.src = e.target.getAttribute('src')} }, true);

HTML

<div class="image">
 <a href="<?php echo $product['href']; ?>">
   <img src="<?php echo $preloader?>" data-src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive lazyload" />
</a>
</div>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!