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 JavaScript Basics (Retired) Introducing JavaScript The Console Challenge Answer

Michael Murphy
Michael Murphy
276 Points

No alerts. No content. Nothing.

Typed the following into scripts.js (I see no obvious way to share the code other than copying and pasting. Really struggling with Treehouse interface. It's a mess in my opinion.):

https://w.trhou.se/t40r2xkt6h

scripts.js file is linked to html via:   <script src="scripts.js"></script> just before the close body tag.

All I get in Chrome is "Can you get the JavaScript to work?" in the browser window.

6 Answers

Colin Marshall
Colin Marshall
32,861 Points

It actually works just fine for me. Try closing out the preview window/tab in your browser, clear your browser cache, and try again.

Agreed, I just forked the workspace and it works. Using IE.

Works on my end too. Is it possible that he has JavaScript disabled?

Michael Murphy
Michael Murphy
276 Points

Sorry for the delay. Lost connection to site and workspace for a while. Cleared cache, re-opened work space and everything works. There's 90 minutes I'll never get back. Thanks all!

Hey Michael,

Can you share your workspace or post your HTML?

Colin Marshall
Colin Marshall
32,861 Points

Sounds like he might not know how to share his workspace.

Michael Murphy to share your workspace, you have to create a snapshot of it. To do this, open up the workspace, click the snapshot button in the upper right corner (it looks like a camera) and provide us with the link to the snapshot.

Michael Murphy
Michael Murphy
276 Points

Edited original post - pasted url to snapshot (please tell me if there's a better way to do that) into original post

Colin Marshall
Colin Marshall
32,861 Points

You say your main.js file is linked in your html, but the code you don't see is in your scripts.js file. Is the scripts.js file also linked in your html? If not, link it too.

Michael Murphy
Michael Murphy
276 Points

Typo. Meant to say: "scripts.js" file is linked to "index.html" file. Copying and pasting code does not work, and I do not yet know how to utilize the snapshot link I created.

Colin Marshall
Colin Marshall
32,861 Points

You have to provide us with the link to your snapshot so we can look at it.

Going out on a whim here but how are you linking your JavaScript files? Are you using the link tag or script tag to do so?

It should look something like this:

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

Also, if the file is nested inside of a folder, make sure to provide the correct file path.

<script src="js/example.js"></script>
Michael Murphy
Michael Murphy
276 Points

How do I respond to all of your comments? There doesn't seem to be a respond option under any of the comments. This one by Collin has an "add comment" btn. Is it just me? Am I having a lsow day? Or is this whole interface unintuitive?

Michael Murphy
Michael Murphy
276 Points

Jacob: my code in html file is: <script src="scripts.js"></script> Wow! My script code pastes into comment window but does not appear when posted. Workspace snapshot: https://w.trhou.se/t40r2xkt6h

Michael Murphy
Michael Murphy
276 Points

Link to snaphot (had to click on it, have it open in a browser, and then copy the url and paste it here. There has to be a more efficient way to share snapshot link). https://w.trhou.se/t40r2xkt6h

Just press f5 and relaunch preview