Title: Lazyloading multiple instances
Last modified: August 15, 2021

---

# Lazyloading multiple instances

 *  Resolved [Bican Marian Valeriu](https://wordpress.org/support/users/vbmv/)
 * (@vbmv)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/)
 * Any idea why the lazyloading js script is loaded multiple times on the page? 
   It happens with both file and inline code.
    WP/Plugins are the latest version.
   Theme is block based/FSE. An example url with a bug can be found here: [https://wecodeart.com/dev/](https://wecodeart.com/dev/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flazyloading-multiple-instances%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Bican Marian Valeriu](https://wordpress.org/support/users/vbmv/)
 * (@vbmv)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/#post-14768534)
 * The same thing happens with JS when minification/concatenation is turned on.
   
   Some JS code is executed multiple times.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/#post-14769987)
 * could you please be more specific which JS’ being loaded multiple times ?
 * on my browser’s request list I didn’t see any duplication.
 *  Thread Starter [Bican Marian Valeriu](https://wordpress.org/support/users/vbmv/)
 * (@vbmv)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/#post-14770098)
 * Its a problem with FSE and upcoming block based themes – as soon as I switch 
   to normal theme everything is fine. This can be closed as that is an unreleased
   WP feature. Sorry to bother.
 *  Thread Starter [Bican Marian Valeriu](https://wordpress.org/support/users/vbmv/)
 * (@vbmv)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/#post-14771808)
 * Found and fixed the issue – was related to the code from:
    [https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/table-of-contents/index.php](https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/table-of-contents/index.php)
   regarding DOMDocument::saveHTML(); I was using a similar approach in my theme–
   you need to use LIBXML_HTML_NOIMPLIED constant to avoid multiple script tags (
   and also remove the generated Doctype)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Lazyloading multiple instances’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

## Tags

 * [lazyloading](https://wordpress.org/support/topic-tag/lazyloading/)

 * 4 replies
 * 2 participants
 * Last reply from: [Bican Marian Valeriu](https://wordpress.org/support/users/vbmv/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/lazyloading-multiple-instances/#post-14771808)
 * Status: resolved