• Resolved ImageAtanas Yonkov

    (@nravota12)


    Dear Team,

    More and more themes prefer to use vanilla js in their code, this means jQuery is not called on the website and code snippets that require the library by Simple Custom CSS and JS plugin are not working! (It throws an error that jQuery is undefined.) Please check my theme Highstarter for reference (disable all active plugins, because any of them might be loading jQuery, then try adding jquery code via Simple Custom CSS and JS plugin). I have the same problem as @michalrama in this thread: jQuery code not working because jQuery is no defined..

    You need to add a check in your plugin to enqueue jQuery automatically if the user uses it in the code snippet from your plugin.

    jQuery(document).ready(function($) {
        //Code
    });

    Please consider adding this to the plugin, this is really important because more and more themes do not use jQuery and a lot of non-tech users ask me for suppport because they cannot figure out why their jQuery script does not work in my theme. Cheers and take care!

    • This topic was modified 5 years, 2 months ago by ImageYui.
    • This topic was modified 5 years, 2 months ago by ImageAtanas Yonkov.
Viewing 1 replies (of 1 total)
  • Plugin Author ImageSilkyPress

    (@diana_burduja)

    Hello Atanas,

    in the plugin’s 3.34 version the jQuery library is enqueued if one of the JS custom codes has the “jQuery(” or “jQuery.” string in it.

Viewing 1 replies (of 1 total)

The topic ‘Please enqueue JQuery if a Custom Script Requires It’ is closed to new replies.