is my Lazy loading code correct?

I am unsure if the code i implemented into our store and was wondering if someone could verify that it is correct.

The code is

{{
//cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js
| script_tag }}

Please let me know if this is correct or not! any thought helps.

What matters is… what does it actually render as, check the source of the actual website in the browser: ctrl+u

As for lazyloading as a feature that’s only the part that loads the script, it does not account for what the rest of the theme may or may not be doing.

any idea how to actually add lazy loading then? if thats only for the script.

Thank you!

@Jdierck Implementation will vary wildly among themes some themes already have it or similar pre setup code to support the feature.

See the docs for the library being used, the themes code or themes doces , combined with shopify theme development.

https://shopify.dev/docs/themes

Past that realize your asking a massively broad question that is beyond a simple forum contribution about a custom implementation for a common web-development pattern.

If you need this website speed theme customization done for you and have the budget then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Hi @Jdierck

Every shopify theme has a lazyload function by default. Why do you need to add a lazy load library? It could affect the speed score of your site.

Hi @Jdierck

This is Richard from PageFly - Shopify Page Builder App

Using an external library for what already exists for your theme is not an optimal way.

Instead of adding the library which changes no thing or even slow down your site, i suggest you should check on your theme script and enable it. Infact its just an image attribute as loading=“lazy”

Hope this can help you solve the issue

Best regards,

Richard | PageFly