Uncaught TypeError: Property '$' of object [object Window] is not a function

Community Forums Forums Design Tips and Tricks Uncaught TypeError: Property '$' of object [object Window] is not a function

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  phamhung 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15574

    phamhung
    Participant
    Post count: 28

    I got that error when processing a javascript file in Genesis. This javascript file is originally from another platform.

    Wondering if anyone has any idea why it has this error please?

    Thanks.

    #16219

    Kraft
    Participant
    Post count: 86

    Yeah, $ is the jquery short function name, which is disabled on WordPress to prevent conflicts. You’d either need to replace $ with jQuery as the function name, or wrap everything is the function below:

    jQuery(function ($) {
    /* You can safely use $ in this code block to reference jQuery */
    });


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #16247

    phamhung
    Participant
    Post count: 28

    Yeah, forgot to update this. I did the same way. More details here http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Thanks for your help, anyway :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.