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

app.js file not connecting - won't turn red

For one, the app.js is under the CSS folder rather than the main Javascript folder. I'm not sure if that is the reason it is not turning red. I get the feeling that it's not connecting right to the HTML file. Where the arrow is in the code, it is red in my example, as well as myHeading after it, unlike in your example. See below:

https://drive.google.com/file/d/1ytGJCMMdPL77XHw4GiIREPooEkmjihiR/view?usp=sharing

1 Answer

Cameron Childres
Cameron Childres
11,819 Points

Hey Joey~

Can you either give us a link to your workspace or share your code so we can look at it? Without seeing the relevant HTML file I don't have a lot to go off of here and I can't tell what specific lesson you're on from your post.

To share the workspace you click the camera icon in the top right to take a "snapshot". This will provide you with a link that we can view and make our own versions of.

To post formatted code directly in the post use the markdown cheatsheet linked below the text box for formatting.

One thing I can offer is that the app.js file in your screenshot is not inside the CSS folder, so if you're trying to link to css/app.js that will not work. The arrow next to CSS that points to the right indicates that the folder is not expanded, so you're looking at files in the main directy. Try simply app.js instead.

Thank you Cameron. I didn't know about the snapshot, that's pretty useful.

I finally figured it out. i had forgotten to link the "app.js" within the index file.

  <script src="app.js"></script>

Stupid mistake, I was working on it forever trying to figure it out. Thanks again for your help.

Cameron Childres
Cameron Childres
11,819 Points

Aha, it's always the little things! Glad you got it worked out.