I'm trying to get API info using jQuery to affect an HTML tag. I'm able to do this, but only when text only is on the URL. (See code)
<script>
$(document).ready(function() {
$.get('https://garli.co.in/api/getdifficulty', function(difficulty) {
$("#difficulty").text(difficulty);
});
});
</script>
<p id="difficulty">Check Network Connection and Try Again</p>
What I'm trying to do is select specific JSON objects (a format that I'm not familiar with), in the style of what is below:
[
{
"name": "Joe",
"last_name": "Smith",
"age": "37"
}
]
How would I get just the "name" value? When I try to get any part of it, what I'm currently recieving is [object Object].