i'm trying to have an api call to the following json url, which opens just fine in a browser: http://api.forismatic.com/api/1.0/GET?method=getQuote&format=json&key=&lang=en However, when i'm doing it using getJson, it's not displaying anything. What could be the error?
Below is the simple code:
$(document).ready(function() {
$("#getQuote").on("click", function() {
$.getJSON("//api.forismatic.com/api/1.0/GET?method=getQuote&format=json&key=&lang=en", function(json) {
$(".quote").html(JSON.stringify(json));
});
});
});
The codepen where it's supposed to run is here: http://codepen.io/Willvlad/pen/VaedOP
What could be a mistake?