I have an html file with json request. I cannot make json show the result. What's the mistake i have?
<p id="syno"></p>
That is where i should see the result and below is the script for that
<script>
var apiUrl = 'http://words.bighugelabs.com/apisample.php?v=2&format=json';
$.ajax({
url: apiURL,
type: "GET",
dataType: 'json'});
success: function (response) {
// The request succeeded
console.log(response);
parseWord(response);
},
error: function (xhr, status) {
// The request failed
console.log(status);
showError();
}
function parseWord(data) {
$('#syno').text(noun.ant);
}
</script>