I need to make a GET request from an external link (the api), though I've continued to google and change my code accordingly but nothing is working..
These are some I've tried..
<script>
$.getJSON('url-goes-here?' + dataString, function(json_data){
alert(JSON.stringify(json_data));
</script>
..
<script>
fetch("https://url-goes-here", {
mode: 'no-cors'
})
.then(function(resp) {
console.log(data.needed_total) // variables in api
});
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
</script>
I've checked whether it's problem with the api itself through postman however works as should.
I also get this error in console
Uncaught 'ReferenceError: $ is not defined
my scripts are