I get this error message in my console when I run my code for the random quote machine:
Mixed Content: The page at 'https://codepen.io/username/pen/BzRzbY?editors=1112' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://quotes.stormconsultancy.co.uk/random.json'. This request has been blocked; the content must be served over HTTPS.
At this point, I’m just trying to get my code to connect with the API, so my javascript so far is:
$.getJSON("http://quotes.stormconsultancy.co.uk/random.json", function(json) { console.log(json); });
I’d like to get a json with a random quote and some other data to pop up in my console when I click “Run”, but obviously, no such luck.
I don’t know if it’s just a setting I need to turn off in Codepen to allow unsecured connections, or if I’m totally missing something in my code. My HTML so far is just like the examples in FCC"s JSON API’s and Ajax lessons (again, hoping to just get something working for now). I plugged in a quote API’s endpoint and tried to get it to print to the console upon success.
I’ve looked at articles explaining getJSON and making simple API requests, and the example code looks pretty much like mine, another example also looks much like mine so I can’t figure out what’s wrong. Or is there a lot I’m missing here?
Thanks!
