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--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

Hi Elissa,

Are you linking to your js in the html document?

i.e.

<script src="script.js"> 

(or whatever the file is named)

Hi 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.

Can 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.

Hey 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>

Hm, 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.

Thanks dan, appreciated

Elissa