Skip to content Skip to sidebar Skip to footer

Jquery - Uncaught Typeerror: $ Is Not A Function

I am so confused...I was working on my site and added some jQuery. Upon testing, I found that the jQuery didn't do anything. I then tried the most simple yet visible code I could t

Solution 1:

Wrap it in a jQuery function, like this:

// Note the "$" inside function() - that's the keyjQuery( document ).ready(function( $ ) {

  $("html").click(function() {
     $("html").html("");
  });

});

Solution 2:

Make sure you include jquery in app/assets/application.js:

//= require jquery//= require jquery_ujs

Post a Comment for "Jquery - Uncaught Typeerror: $ Is Not A Function"