I am wondering why when I fetch a JSON file it's not working. Here is the link and the way I use fetch()
which was working on my localhost wamp64.
Link: http://zetcode.com/javascript/jsonurl/
All the ways of getting JSON data from that link is 100% working, thanks for that website and the people behind that post.
All are working as expected in my localhost here's screenshot
IMG: https://www.screencast.com/t/yafc6w900aM
By the way what I am trying to achieve is fetch data from Goeplugins in JSON format because I am using JavaScript...
In my localhost as you see in images attach link everything is working fined but on live site it's not working, I try to solve but I really need help for that one.. here's link,
Live Site: https://www.gpsup.andali.ph/fetch
Screenshot: https://www.screencast.com/t/BDcuqWxK
The file I was run in my localhost is absolutely the same the file I run to live site
Here's my codes:
<script>
var getRequest_uri = "http://www.geoplugin.net/extras/location.gp?lat=14.3164400&lon=120.9597400&format=json"; //getJSON_gps('location', latitude, longitude);
fetch(getRequest_uri).then( res => res.json()).then((out) => {
console.log('Output: ', out);
}).catch(err => console.error(err));
</script>
I read post from this site says about HTTP / HTTPS issue adding this line code below in my meta but still not work
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" >
PLEASE DEVELPERS I NEED HELP, THANKS IN ADVANCE...