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
elissachapman
2,987 PointsJavascript Basics--Workspaces does not run any of my code
Hi there. I have been having this problem with almost every exercise in "Javascript Basics".
For example:
var visitor = prompt("What is your name?");
var message = "Hello" + visitor;
document.write(message);
This is cut and pasted from my workspaces in "Capturing Visitor Input".
The code seems correct and when i click preview it doesn't run any JS. It just runs the html. I can't preview anything. I pass all the challenges fine doing exactly the code I have used in workspaces. Any advice appreciated! I hope the answer isn't "This is a Chrome issue!". Thanks elissa
3 Answers
Dan Oswalt
23,438 PointsHi Elissa,
Are you linking to your js in the html document?
i.e.
<script src="script.js">
(or whatever the file is named)
Dan Oswalt
23,438 PointsCan you share your code? It's hard to diagnose without seeing what is going on. Chrome shouldn't be a factor. Check out the Markdown Cheatsheet, it's a little tricky to get the code looking right.
elissachapman
2,987 PointsHey Dan,
Code I am trying to run is in my question, cut and pasted from workspaces The link to the js file is:
<script src="scripts.js"></script>
Dan Oswalt
23,438 PointsHm, the link and the js script look fine from here also, I'm afraid I'm not sure what to try, maybe the preview screen is a little wonky and needs a kick. Sorry that I couldn't help! Hope you get a response from treehouse.
elissachapman
2,987 PointsThanks dan, appreciated
Elissa
elissachapman
2,987 Pointselissachapman
2,987 PointsHi Dan,
yes the HTML document links to the JS file. The html file has been created by the tutorial.
Thanks! I have also emailed support but no response yet.