A developer is experiencing image loading failures when using jQuery Ajax to fetch and append product HTML in Shopify’s Empire theme. The issue stems from the theme’s lazyload functionality, which prevents dynamically loaded images from rendering properly.
Current Status:
Images load correctly when lazyloading is disabled
Images fail to load when using Empire theme’s standard image rendering with Ajax requests
Screenshots demonstrate the before/after behavior of the issue
Proposed Solution:
One responder suggested using a “section copy method” instead of replacing individual elements—fetching entire content sections to ensure proper image loading within the theme’s framework.
Outcome:
The discussion remains unresolved. The original poster requested implementation guidance for the suggested approach, but no detailed solution has been provided. Another user has since reported encountering the identical issue, indicating this may be a broader problem with the Empire theme’s Ajax compatibility.
Summarized with AI on October 31.
AI used: claude-sonnet-4-5-20250929.
I’m facing an issue with the Empire theme’s latest version. I have created a custom colour option as an individual product and fetched that product on click by jQuery Ajax. But when I make an Ajax request and append fetched product HTML to the page, everything works fine except images. Images are not loading due to the lazyload of the Empire theme.
I’ve tried it without lazyloading in images, and then images are loading but when I use the Empire theme image rendering way, the images are not loading on Ajax’s request.
Please help me to solve this issue.
Please check that screenshot for more clarification:
To address the issue with images not loading on Ajax requests due to the Empire theme’s lazyloading functionality, we recommend considering an alternative approach. Instead of replacing individual elements via Ajax, we suggest utilizing a section copy method. This involves fetching and rendering entire sections of content, including images, ensuring they load correctly within the theme.