Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

"$ is not defined" error in the console... jQuery

The console is saying that I have one error which is $ is not defined. What do I need to do.

1 Answer

Hi Arthur!

That is because jQuery is a long list of methods prewritten in javascript for you to use. It is already downloaded on the treehouse workspaces and the code challenges. If you are planning on writing it on a text editor, you will need to download it or or link it with a cdn.

If you download it you will have to keep it with your other project files and link it with a script tag, and then in another script tag you will write your jquery code.

If you link it with a cdn, you do not need to download it. You will just put a link in a script tag just like you would if you had downloaded it, but instead of the file, you would put a link to a file on the web.

Jquery download

There is a big download button, and if you scroll down you will see the google cdn, microsoft cdn, etc.

Hope this helped!

Thanks! :)

Thank you! That was much more of a complex process than I expected. But in the end I figured it out.