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 Where Does JavaScript Go?

Jessica Southwick
Jessica Southwick
448 Points

The script for the first command does not appear to be linking to the .js file - where am I going wrong?

https://w.trhou.se/w2094vjffv

Above is a snapshot to the code. Strangely, the snapshot does not show that there is any code in the .js file when I view it, so I am unsure if it is my alert that is wrong, or there is simply a workspace issue?

The .js file has the following code:

alert("Hey you are back for more?");

Thanks for any guidance!

josephr
josephr
18,877 Points

Unless I misunderstand the question there does not appear to be any problem. I think your .js file is just empty. There is no problem with the link. The alert script you are referring to - alert("You are back for more?") - is in the html between script tags.

Jessica Southwick
Jessica Southwick
448 Points

Thanks, Joseph.

There actually was code in the .js file, it just did not show up in the snapshot for some reason. I think I'm going to chalk this up to a dashboard quirk/error and keep moving along.

I appreciate you taking time to provide an answer.

7 Answers

I have same issue. Workplace doesn't run javascript when <script src="scripts.js"></script> is placed inside head tag without <script>alert("Hey you are back for more?")</script> even though if sould work just with <script src="scripts.js"></script>.

I hope the teamtreehouse solve this issue ASAP.

Tara Edwards
Tara Edwards
1,355 Points

Ditto. I kept trying different things and even changed browsers, but my script will not render in this workspace, but it will in the prior one.

I've had the same issue so I think you're exactly right that it's a quirk.

First, you have to make sure that you write the actual script inside the "scripts.js". Then, go to File and click "Save All", or save "scripts.js". I had the same issue but both messages popped up when I saved the scripts.js file again.

i have the same issue and i tried all your ways but it still didn't work? :(

Old but my problem was putting the script.js file in the css folder in the workspace!

Exact same problem, initially. I went over the scripts.js syntax a million times, but couldn't get the scripts.js dialog box to open. I used the "inspect" tool on the browser, and there was 1 error that read "Uncaught SyntaxError: missing ) after argument list". I quadruple checked, and both parentheses were there, so I think it's just a funky workspaces issue. I simply deleted the alert("Hey you're back for more?"); retyped it the exact same way, and now it works fine.