How to fix WordPress jQuery is not defined 1

How to fix WordPress jQuery is not defined

wp_enqueue_script( 'Jquery-script', plugin_dir_url( __FILE__ ) . 'https://cdn.myedukit.com/js/my-script.js', array( 'jquery' ), '1.0.0', true  );

Here is what the above code is Doing:
1. wp_enqueue_script() is a WordPress function that allows you to load a JavaScript file into your theme.
2. The first parameter is the name of the script. This is used to identify the script if you need to deregister it.
3. The second parameter is the URL of the script. In this case, we’re using the plugin_dir_url() function to get the URL of the plugin directory and then appending the path to the script file.
4. The third parameter is an array of the names of any other scripts that this script depends on. In this case, we’re saying that our script depends on jQuery.
5. The fourth parameter is the version number of the script. This is used to make sure that the latest version of the script is loaded.
6. The fifth parameter is a boolean value that determines whether the script should be loaded in the header or the footer.

Similar Posts