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

Ben Hernandez
Ben Hernandez
3,578 Points

Why am I getting a "Failed to load resource: the server responded with a status of 404 (Not Found)" error?

<!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 src="js/poop.js"></script>
</body>
</html>
var html = '';

for ( var i = 1; i <= 10; i += 1 ) {
  html += '<div>' + i + '</div>';
}

document.write(html);
console.log(html);

Mod Edit: Fixed Code Formatting

rydavim
rydavim
18,813 Points

When posting your code to the forums, you can use some markdown to make it easier to read.

```language

Your Code Here

```

1 Answer

Emil Nielsen
Emil Nielsen
2,364 Points

I think this is because it cannot find your styles.css stylesheet or your poop.js script.

Try to check if you have spelled the folder-name correct and the filename and directory correct.

Mod Edit: Changed Comment to Answer so that it may be voted on or marked as best.

Adrian Cueto
Adrian Cueto
475 Points

Yeah i just clicked on style.css in my workstation aswell as all other folders. then it worked. thanks!