• Hello there. I’m getting an error from your plugin that prevents the rest of the JavaScript from executing.

    ytpp-main.js?ver=4.7:46
    Uncaught ReferenceError: jQuery is not defined
      at ytpp-main.js?ver=4.7:46 
    (anonymous) @ ytpp-main.js?ver=4.7:46

    When you view source, you can see jQuery is included in the head tag, but after your plugin’s script.

    <script type='text/javascript' src='https://site.ca/wp-content/plugins/youtube-playlist-player/js/ytpp-main.js?ver=4.7'></script>
    <script type='text/javascript' src='https://site.ca/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>

    How can I move your script below?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DERNERSERFT

    (@garl)

    I updated a function in youtube-playlist-player.php and now it works.

    function ytpp_pss() {
    	wp_enqueue_style('ytpp', plugins_url('css/style.css', __FILE__ ));
    	wp_enqueue_script('ytpp', plugins_url('js/ytpp-main.js', __FILE__ ));
    }
    function ytpp_pss() {
    	wp_register_style('ytpp', plugins_url('css/style.css', __FILE__ ), '', '', 'all');
    	wp_enqueue_style('ytpp');
    	wp_register_script('ytpp', plugins_url('js/ytpp-main.js', __FILE__ ), array('jquery'));
    	wp_enqueue_script('ytpp');
    }

    Obviously editing the plugin is not ideal, so can you make that change in your next update? Thanks!

    Plugin Author Ciprian

    (@butterflymedia)

    Hi, I will make the change in the next update. Thank you for your feedback.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught ReferenceError: jQuery is not defined’ is closed to new replies.