I have a query result generated on a local server in json format using a link similar to the one below. when I copy and paste the generated result and save it on a file locally and call that, it reads it fine and I dont get an error (it goes to the success function), but if it accesses it via the url as shown below, it goes to the error function. Anyone knows what i'm missing here?
<script>
$.ajax({
url: "http://localhost:5001/time_interaction/19790101/19800101/month",
dataType:'JSON',
success:function(data){
console.log(data)
},
error:function(){
console.log('error')
}
});
</script>