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 trialJessica Southwick
448 PointsThe script for the first command does not appear to be linking to the .js file - where am I going wrong?
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!
Jessica Southwick
448 PointsThanks, 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
Hanna Han
4,105 PointsI 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
1,355 PointsDitto. 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.
Arran Kirkup
3,200 PointsI've had the same issue so I think you're exactly right that it's a quirk.
Dan K
10,689 PointsFirst, 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.
Zaynah Chowdhury
1,019 Pointsi have the same issue and i tried all your ways but it still didn't work? :(
Caleb Ferguson
571 PointsOld but my problem was putting the script.js file in the css folder in the workspace!
John McDonald
1,264 PointsExact 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.
josephr
18,877 Pointsjosephr
18,877 PointsUnless 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.