I am having difficulties retrieving data from API in a given URL http://localhost:1337/api/volcano.
The data that is captured from the API is in JSON format. Now, how do I fetch and display in the browser the following array of data?
{"volcano":[{"id":12,"Name":"Krakatoa","Location":"AUSTRALIA","History":"The 1883 eruption of Krakatoa","Active":"dormant"}]}
My Trials
var settings = {
"url": "http://localhost:1337/api/volcano",
"method": "GET",
"timeout": 0,
};
$.ajax(settings).done(function (response) {
var data = $response;
});
display
<div id="data"></div>