Closed mbaierl closed 5 years ago
Thanks for the report @mbaierl!
I think the most error-proof way to fix this is to disable the transformation of images when content is fetched via Ajax (by checking whether doing_ajax()
or x-requested-with: XMLHttpRequest
header is present).
This would mean images loaded via Ajax are not lazy-loaded, but this action is not predictable for the plugin, so it would require developer intervention (e.g. trigger an event that the Native Lazyload plugin knows it should recheck for new images). I prefer going with the safer solution first. Last but not least, if you load via Ajax, these images aren't "strictly" immediately loaded anyway.
What do you think?
Issue Overview
When using the prev/next buttons on a blog page no images are shown on the previous/next page.
Steps to Reproduce (for bugs)
Expected Behavior
Images should load.
Current Behavior
The image is not loaded and the image tag remains like this:
<img src="https://mbaierl.com/wp-content/plugins/native-lazyload/assets/images/placeholder.svg" alt="Vorsicht! Diese 15 Bücher könnten dein Business (und dein Leben) verbessern!" class="lazy" width="1080" height="675" loading="lazy" data-src="https://mbaierl.com/wp-content/uploads/1/business-buecher-og-1080x630.png">