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 AJAX Basics (retiring) Programming AJAX Stage 2 Challenge Answer

Abidur Rahman
Abidur Rahman
1,166 Points

GET 404 Error on favicon.png

GET http://port-80-s8v54mjatt.treehouse-app.com/favicon.png 400 (Bad Request)

Could this be an error on the client-side ?

My code -: var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if(xhr.readyState === 4 && xhr.status === 200) { var employees = JSON.parse(xhr.responseText); var statusHTML = '<ul class="bulleted">'; for (var i=0; i<employees.length; i += 1) { if (employees[i].inoffice === true) { statusHTML += '<li class="in">'; } else { statusHTML += '<li class="out">'; } statusHTML += employees[i].name; statusHTML += '</li>'; } statusHTML += '</ul>'; document.getElementById('employeeList').innerHTML = statusHTML; } }; xhr.open('GET', '../data/employees.json'); xhr.send();

var request = new XMLHttpRequest(); request.onreadystatechange = function () { if(request.readyState === 4 && request.status === 200) { var rooms = JSON.parse(request.responseText); var statusHTML = '<ul class="rooms">'; for (var i=0; i<rooms.length; i++) { if (rooms[i].available === true) { statusHTML += '<li class="empty">'; } else { statusHTML += '<li class="full">'; } statusHTML += rooms[i].room; statusHTML += '</li>'; } statusHTML += '</ul>'; document.getElementById('roomList').innerHTML = statusHTML;

} }; request.open('GET', '../data/rooms.json'); request.send();

2 Answers

Hi,

Even i get this '404' error message while doing few projects, The issue might because the image png file referenced in one of the project files is not available in treehouse server now.

The program will execute without any issues so you can ignore this error.

Thanks, Aishu

usually just refreshing the page takes care of that. I find that when I am using live server on actual projects, for some reason I get the 404 favicon icon error, but when I reload the page all is good. I dont know why you are getting this in the workspace if that is what you are using, unless you were doing this on your computer and making the project as you go along. If that is what you were doing, making it from scratch on your cpu and not using the treehouse launchspace, than reloading should take care of that.