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: GET 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">
  <meta charset="UTF-8">
  <link rel="stylesheet" href="css/styles.css">
<body id="color">
<script>var html = "";
      for (var i=1; i<=10; i +=1) {
            html += "<div>" + i + "</div>";

Just thought I would let you know.


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