• Resolved AnthonyChurch

    (@anthonychurch)


    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.au

    Has anybody else had this same issue?

    Thank you

    Anthony

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JQuery error : undefined is not a function’ is closed to new replies.