jQuery

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.


ReferenceError: $ is not defined

You can not use jQuery syntax while the jQuery itself is yet not ready. You need to change it with preload style, or keep doing it in an old school way before your jQuery is fully ready.

// in place of
$(document).ready(function(){ alert('Document ready!'); });
$(window).on("load", function(){ alert('Window ready!'); });

// use preload style
preloadReady(function(){
    alert('Window Document ready!');
});

// or use addEventListener as an alternative
document.addEventListener('DOMContentLoaded', function(){ alert('Document ready!'); });
window.addEventListener('DOMContentLoaded', function(){ alert('Window ready!'); });