Title: Inline JavaScript / CSS not lazyloading compatible
Last modified: April 22, 2020

---

# Inline JavaScript / CSS not lazyloading compatible

 *  [Sandra](https://wordpress.org/support/users/foodcat/)
 * (@foodcat)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/inline-javascript-css-not-lazyloading-compatible/)
 * Hi,
 * your inline code doesn’t work when jQuery is loaded lazy.
    For non render blocking
   loading methods its best to let jQuery load later.
 * I see that you have thought about not loading your code on every page thats nice
   🙂
    but it would be great to have a selection in admin panel to use external 
   file, so autoptimize can minimize them. I also use asset cleanup to select what
   I want to load when, so your function it can easily rebuild for those who want
   to minimize there scripts.
 * those are the lines I mean:
 *     ```
        $output .= "<style type='text/css'>.stcr-hidden{display: none !important;}</style>";
       				$output .= "<script type='text/javascript'>jQuery(document).ready(function($){var stcr_form=$('div.stcr-form');stcr_form.prevUntil('form').each(function(){var _this=$(this);if(_this.find(':input[type=\"submit\"]').length){stcr_form.remove(),_this.before(stcr_form);$('div.stcr-form').removeClass('stcr-hidden');return false;}})});</script>";
       ```
   
 * PS: thanks for the nice plugin, I “forked” myself a working version so you don’t
   have to hurry

Viewing 1 replies (of 1 total)

 *  Plugin Author [WPKube](https://wordpress.org/support/users/wpkube/)
 * (@wpkube)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/inline-javascript-css-not-lazyloading-compatible/#post-12716243)
 * Hi [@foodcat](https://wordpress.org/support/users/foodcat/)
 * Thanks for pointing it out, we’ll get that sorted out.
 * You’re welcome, happy to hear you like it 🙂

Viewing 1 replies (of 1 total)

The topic ‘Inline JavaScript / CSS not lazyloading compatible’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/subscribe-to-comments-reloaded_f0f9fc.
   svg)
 * [Subscribe To Comments Reloaded](https://wordpress.org/plugins/subscribe-to-comments-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe-to-comments-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WPKube](https://wordpress.org/support/users/wpkube/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/inline-javascript-css-not-lazyloading-compatible/#post-12716243)
 * Status: not resolved