jQuery not defined
-
Hope someone can help. I want use jQuery on my pages, but just cannot get it to work properly. I have enqueued my script and jQuery in my themes function.php file based on instructions in these tutorials.
http://wp.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins/
http://wpcandy.com/teaches/how-to-load-scripts-in-wordpress-themes/#.UtXAAnlBRUsI know my script is loading as it it logging some things to the console. However, and I can see that query has been loaded from my server in the developer tools… However – jQuery functions I am calling are having no effect, and further more if I try to access jQuery from the developer tools interpreter I get:
ReferenceError: jQuery is not defined
What am I doing wrong?
Here is my code in my functions.php:
// Let's hook in our function with the javascript files with the wp_enqueue_scripts hook add_action( 'wp_enqueue_scripts', 'ddd_load_scripts' ); // Register some javascript files, because we love javascript files. Enqueue a couple as well function ddd_load_scripts() { if (!is_admin()) { wp_enqueue_script( 'jquery' ); wp_register_script( 'headscript', get_theme_root_uri()."/DDD2014/js/headscript.js"); wp_enqueue_script( 'headscript' ); } }
and an example of my js:
jQuery(“#aboutpop”).css({ opacity: 0.5 });
- The topic ‘jQuery not defined’ is closed to new replies.