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 jQuery Basics (2014) Introduction to jQuery Ways to Include jQuery in a Project

question

What happend?. it's the same code nothing changed only the function syntax passed in did something happen

didn't understand? the question will be defined below

why the code didn't run only the function syntax passed in why did this happen? did the teacher included a special file? or it's a bug by the website?

1 Answer

Ezra Siton
Ezra Siton
12,644 Points

Hi. Add code example or workspace to your Q. It's hard to know like this what is the problem/error.

In general, if you want to use Jquery you need first to include Jquery library. The code below will throw this error:

Uncaught ReferenceError: $ is not defined

<script>    
        $( "p" );   
    </script>

    <script
    src="http://code.jquery.com/jquery-3.2.1.min.js"
    integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
    crossorigin="anonymous">
    </script>

Thank You Erza, Your Answer Helped Me Alot!.