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 Introducing the Practice

viviannevog
viviannevog
1,293 Points

Workspace doesn´t work

I launched the workspace for this workshop and did some basic stuff first like console.log("5"); to test. Nothing was shown in the console after loading the frontend. I tried different stuff, nothing was working. Any idea?

Check if you add the script tag of your js to the index.html?

viviannevog
viviannevog
1,293 Points

Thanks balthazear, but yes I added it to the index.html. It also loads in the frontend but doesn´t run my code.

Try on different browser, see if the console will work or not

viviannevog
viviannevog
1,293 Points

It doesn´t work on any browser. Does it work with you?

Well the last time I had problem, I checked if my script tag was included and that wasn't it so I uninstall and reinstall chrome, weird but works for me at that time.

Sean Flanagan
Sean Flanagan
33,235 Points

Hi viviannevog.

The geometry.js file is located in the js folder. In order to access the file, you need to use a slash to work your way down the file tree. The type attribute tells the browser what kind of file is being accessed. The src attribute gives the location and name of that file.

<body>
  <script type="text/javascript" src="js/geometry.js"></script>
<body>

I hope this helps.

Sean

1 Answer

Eric Perozich
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Eric Perozich
Front End Web Development Techdegree Graduate 23,536 Points

you need to check your tags closely... one simple character can disrupt the whole code. in my case you can look at my original script tag:

<script scr="js/geometry.js"></script>

notice what's wrong?

it should be:

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

if you didn't catch it, I flipped the 'c' and 'r' in the "src=". this led to me being unable to display any commands from the geometry.js file, and I spent about 20 mins trying to figure out why I wasn't outputting anything to the browser.

if you encounter the same issue, look closely at your <script></script> tag. make sure you have each part correct.

  1. check your spelling of, SCRIPT, SRC, and the path to: "js/geometry.js" is 100% correct.

  2. did you include an "=" between your src and file path?

  3. check that your file path is surrounded with both an opening and closing "quote".

  4. check that you closed your tag with a </script>.

  5. if you still cannot find the error, copy and past the code from here into your index.html file and see if that fixes the issue. If it does, then use the undo command and see if you can find the error yourself.