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 Introduction to jQuery Hello, jQuery! Setting Up jQuery

Any reason why example would not work on an outside editor?

I have been using the Microsoft Expression Web 4 editor, and just ran into what my first problem might be when not using Workspaces.

First of all, in the project files, there is nothing that deals with this second video and what Aisha Blake demonstrates (with the "Thing..." unordered list. All of the files that get downloaded through the Project Files section, seem to only have something to do with the course project.

So, after I typed up all of the HTML for the index.html file, as well as the same coding for the app.js file, I inserted the embedded script from the CDN just like the instructor did. Yes, I did make sure to put it before the script tag containing the app.js. So, to this point, everything is exactly the same.

However, the page loads with the list visible (as it should), but nothing at all happens when I click on any of the list items. Looking at the JavaScript console, I get two errors:

Here is the quote of the first error that I encountered:

Access to Script at 'file:///C:/Users/Stedman/Documents/Treehouse/TreehouseCourse/FullStackJavaScript/6_IntroTojQuery/1_Hello%20jQuery/jquery-3.1.1.min.js' from origin 'null' has been blocked by CORS policy: Invalid response. Origin 'null' is therefore not allowed access.

Here is the quote of the second error that I encountered:

Uncaught ReferenceError: $ is not defined

Just to add, I went ahead and opened up Workspaces and followed along once more using it, and everything worked fine. So, is there a reason that using another editor would cause this to happen, or can you tell me what is happening?

1 Answer

Would be easier to assess if you uploaded your code. My guess is that there is a typo somewhere, or you might have adblock or something similar blocking the file. The second error comes from jQuery not being loaded.