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 trialKarina Gaulin
790 PointsXMLHttpRequest cannot load
Can a mod please look at this error on my site and help me fix this? karinafarina.com
1 Answer
Kevin Korte
28,149 PointsHey Karina, it looks like there are two issues, the first is your javascript isn't finding, and thus passing in a tth username to get the JSON data back. You can see in the console log it's trying to find /undefined.json
which it can't. To find your profile, it should be looking for https://teamtreehouse.com/karinagaulin.json
This is coming from your treehouse.js file.
Secondly, your JSON request is requesting http
, but I believe now it has to be requested through https
, and I think if you modify the the treehouse.js file with that as well, the CORS error will go away.
Karina Gaulin
790 PointsKarina Gaulin
790 PointsModerator edit: Error captured from console:
XMLHttpRequest cannot load http://teamtreehouse.com/undefined.json. Redirect from 'http://teamtreehouse.com/undefined.json' to 'https://teamtreehouse.com/undefined.json' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://karinafarina.com' is therefore not allowed access.