JQuery error : undefined is not a function
-
Hi,
I am wanting to add a custom javascript that reference jquery.
I believe that I have done all the right things when queueing the scripts.
I added the following function to my functions.php file that is located in my themes/inc folder
function ac_jquery_loader() {
wp_register_script( ‘my-script’, get_template_directory_uri() . ‘/js/ac_StickyFooter.js’, array( ‘jquery’),”,true );
wp_enqueue_script(‘my-script’);
}
add_action( ‘wp_enqueue_scripts’, ‘ac_jquery_loader’ );My java script is the in producing the undefined error is simply:
var h = window.innerHeight; //normal JS
var windowHieght = $( window ).height();
alert(windowHieght);The normal JS works fine all by its own.
the website address is:
http://www.winmaleerfs.com.auHas anybody else had this same issue?
Thank you
Anthony
- The topic ‘JQuery error : undefined is not a function’ is closed to new replies.