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 Loops, Arrays and Objects Simplify Repetitive Tasks with Loops For Loops

There is a problem with the workspace which results in the code not running.

Hi, the code as it stands does not run. I've done some debugging in Chrome's console and I get the following error:

port-80-jvp2bpc1v8.treehouse-app.com/:9 GET http://port-80-jvp2bpc1v8.treehouse-app.com/js/script.js 404 (Not Found)

It seems as though the workspace is having problems loading the associated script file (i did make sure the path in the src was correct). What I did to fix the problem was to embed the js code directly in the HTML and it worked.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Circles</title>
  <link rel="stylesheet" href="css/styles.css">
</head>
<body id="color">
<script>var html = "";
      console.log(html);
      for (var i=1; i<=10; i +=1) {
            html += "<div>" + i + "</div>";
            console.log(html);
            }
          document.write(html);</script>
</body>
</html>

Just thought I would let you know.

Thanks.

Tyler Kesling
Tyler Kesling
6,905 Points

I had the same issue, then I remembered to save the index.html file as well as script.js.

Immanuel Jaeggi
Immanuel Jaeggi
5,164 Points

Ya I embedded it directly as well...funny