I'm new to atom and programming in general. I keep getting a file not found error


#1

I’m learning javascript on teamtreehouse.com and they have an in browser text editor that works fine with the html that i’m using but I want to use an offline browser that doesn’t shut down every so often from losing connection to the server. I can show screen captures of things on the website if requested.

this is the error message in the console>>
Index.html:14 GET file:///C:/Users/amalg/Desktop/Atom%20Programming.html/CSS/js/students.js net::ERR_FILE_NOT_FOUND

here’s the html i’m using>>

Students

Students

Here’s the javascript I’m trying to use>>

var students = [
{name: “Alice”, track: “iOS”, achievements: 1, points: 100},
{name: “Bob”, track: “Web Design”, achievements: 2, points: 96},
{name: “Carol”, track: ‘Front End Development’, achievements: 3, points: 140},
{name: “Dave”, track: “Mystery”, achievements: 4, points: 200},
{name: “Alice”, track: “Enigma”, achievements: 5, points: 10}
];
var print = function(message) {
var outputDiv = document.getElementById(‘output’);
outputDiv.innerHTML = message;
}

for (var stats in students ){
console.log(students);
document.write(students)
}


#3

Apparently html executes in the comments. oops.

!DOCTYPE html>
html lang=“en”>
head>
meta charset=“utf-8”>
title>Students

link rel=“stylesheet” href=“styles.css”>
/head>
body>
h1>Students
div id=“output”>

/div>
script src=“js/students.js”>
/body>
/html>


#4
Students

Students


#5

You can mark your code as code by highlighting it and pressing the </> button above the editor.

Which console? It would definitely help to have a screenshot here.

The question is why src="js/students.js" is getting turned into file:///C:/Users/amalg/Desktop/Atom%20Programming.html/CSS/js/students.js. It’s unusual, because the most likely resolution of that file path would be to look at file:///C:/Users/amalg/Desktop/js/students.js. Is that where the file is?


#6

I fixed the problem, I moved the files to a different folder and then when i opened the html file in chrome and in the Ctrl + Shift + J console I was not seeing any errors in the console and everything was working fine. There also might have been problems with the html. Sorry if I wasted your time. :sweat: