$('#btnOcean').click(function() {
$.ajax({
url: 'libs/php/getOceans.php',
type: 'POST',
dataType: 'json',
data: {
latlon: $('#selOcean').val()
},
success: function(result) {
console.log(JSON.stringify(result));
if (result.status.name == "ok") {
$('#txtDistance').html(result['data'][0]['distance']);
$('#txtGeoname').html(result['data'][0]['geonameId']);
$('#txtName').html(result['data'][0]['name']);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error:", textStatus, errorThrown);
}
});
});