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 Programming AJAX Parsing JSON Data

I get an error when running the code

I get an error when running the code: var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { console.log(xhr.responseText); } } xhr.open('GET', 'data/employees.json'); xhr.send();

the console displays: port-80-bbkse5stv7.ecs-production.treehouse-app.net/:6 Mixed Content: The page at 'https://port-80-bbkse5stv7.ecs-production.treehouse-app.net/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Varela+Round'. This request has been blocked; the content must be served over HTTPS. port-80-bbkse5stv7.ecs-production.treehouse-app.net/:8 GET https://port-80-bbkse5stv7.ecs-production.treehouse-app.net/js/midget.js net::ERR_ABORTED 404

I tried to remove the google text link in the index.html. This removes the first error, but I still get the 404 error in my request.

Best regards, Lars

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

Hi Lars Johansen it would be helpful if you could include your workspace so we can take a look at the code properly. Having said that, your request is to a local file that you need to have alongside your JS file: data/employees.json. 404 represents not found.

1 Answer

I figured out the 404 error myself. It was a typo in the link in index.html. However the google text error persist. You might consider updating the google text link in the workspace in the future. BR Lars