Hi All,
I can’t manage to get either getJSON or ajax to display the returned json object from a working url: http://www.ourmanna.com/verses/api/get/?format=json&order=random
here is my codepen: http://codepen.io/RyzorBent/pen/GmXPEZ
I searched around on the forum and online, but for some strange reason my code is not behaving
$(document).ready(function() {
//$.ajaxSetup({ cache: false });
$("#getQuote").on("click", function() {
console.log("button clicked");
$(".message").html("<p>text has appeared, there!</p>");
//$.getJSON("http://www.ourmanna.com/verses/api/get/?format=jsonp&order=random", function(verse) {
//console.log("inside getJSON");
//});
$.ajax({
url: "http://www.ourmanna.com/verses/api/get/?format=jsonp&order=random",
dataType: "json",
success: function(verse){
console.log("inside ajax");
$("#test").html(verse.text);
}
});
});
});
Will appreciate your help.