• Resolved Thomas Maier

    (@webzunft)


    Hi there,

    I have a user of my Advanced Ads Pro plugin whose ads are not loading because your lazy load feature “optimizes” JavaScript code.

    I have seen this with WP Rocket and their Lazy Load plugin as well and they were able to fix it quickly.

    This is a rough draft of what is happening.

    Advanced Ads has a feature that loads ad content using JavaScript. The code would look like this:

    <script>window.advads_passive_ads = {"<img src=\"https:\/\/example.com\/wp-content\/uploads\/2019\/04\/BANNER-600x300.gif\" width=\"300\" height=\"600\" alt=''\/>"};</script>

    With your lazy load feature enabled, the code is changed to something like this:

    <script>window.advads_passive_ads = {"<img data-lazyloaded="1" src="https://somelinktoimage.gif" width=\"300\" height=\"600\" data-src='https:\/\/example.com\/wp-content\/uploads\/2019\/04\/BANNER-600x300.gif' alt=''\/>"};</script>

    Since the apostrophes are not escaped, the whole code breaks.

    Thanks,
    Thomas

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @webzunft, thanks for reporting the issue, temporary you can put the image name to Litespeed Cache > Settings > Media > Lazy Load Image Excludes for excluding that image from Lazyload. We will discuss with our developer by default excluding the images under javascript.

    Thread Starter Thomas Maier

    (@webzunft)

    Hi there,

    what came out of the discussion? I was not asking for a single site here, but for over 100,000 users of our plugin, so a manual fix is not possible.

    Thanks,
    Thomas

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

The topic ‘Lazy Load breaking JavaScript code’ is closed to new replies.