Skip to main content
1 of 3
Mild Fuzz
  • 4.2k
  • 8
  • 39
  • 53

$ not defined using jQuery in Wordpress

I know that jQuery is loaded, because I can switch out the $ for 'jQuery' and everything behaves as expected, but this will be a messy script if I can't fix this

This script:

jQuery(document).ready(function(){
    $("ul.vimeo_desc_feed li a").click(function(){
        alert($(this).attr('href'));
        return false;
    })
    
});

Produces the error $ is not a function

This script:

jQuery(document).ready(function(){
jQuery("ul.vimeo_desc_feed li a").click(function(){
    alert(jQuery(this).attr('href'));
    return false;
})

});

works fine.

Mild Fuzz
  • 4.2k
  • 8
  • 39
  • 53