There are lots of javascript questions on SO, where OP is using some library, for example jQuery, and is getting following error:
ReferenceError: libraryName is not defined
Some examples:
- JQuery - $ is not defined
- Uncaught ReferenceError: _ is not defined from restangular
- What is the cause for "angular is not defined"
- Uncaught ReferenceError: cordova is not defined
- Uncaught ReferenceError: angular is not defined at angular-moment.js
- Google Maps API: markerwithlabel.js - Uncaught ReferenceError: google is not defined
This error is usually caused by one of the following:
- not including the library file at all,
- including scripts in wrong order (i.e. using a script which depends on the library before including the library).
That makes all these questions duplicates, because there is one solution to all of them. So, I think we need a general reference question for such questions, which would apply to any JavaScript library and provide full, comprehensive, canonical answer.
It seems that there is a question which could be considered a general reference, but it's only about jQuery. It rather wouldn't be a good idea to close a question about, for example, Underscore.js as a duplicate of it.
<iostream>
.