JavaScript Fetch JSON
fetch('./yourjson.json')
.then((response) => response.json())
.then((data) => {
console.log(data);
})
Lioruby
fetch('./yourjson.json')
.then((response) => response.json())
.then((data) => {
console.log(data);
})
fetchJsonp('/users.jsonp')
.then(function(response) {
return response.json()
}).then(function(json) {
console.log('parsed json', json)
}).catch(function(ex) {
console.log('parsing failed', ex)
})