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 trialLewis Turner
10,930 PointsFailed to load resource: the server responded with a status of 404 (Not Found)
Hi
I am getting the above error in workspaces. I have checked and re-checked my code but I can't figure out what is causing it...
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var employees = JSON.parse(xhr.responseText);
}
};
xhr.open('GET', 'data/employees.json');
xhr.send();
https://teamtreehouse.com/workspaces/16510372#
Any help would be much appreciated!
Cheers
Lewis
Lewis Turner
10,930 PointsAah, thats annoying. It works for me :(
This is my code...
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var employees = JSON.parse(xhr.responseText);
}
};
xhr.open('GET', 'data/employees.json');
xhr.send();
2 Answers
Lewis Turner
10,930 PointsCrisis averted. I deleted the workspace, loaded it up again, pasted my js back in and re-added the script tag, and it worked. Workspaces was obviously having a bit of a moment! :o)
Jennifer Nordell
Treehouse TeacherAwesome! Because I've looked and looked and didn't see the problem.
Lewis Turner
10,930 PointsMe either. I was well and truly stuck!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherIronically enough, I get a 404 when I try to look at the link to your workspace.