KolaCaine KolaCaine - 9 months ago 32
Ajax Question

Can't display JSON with AJAX

I have a JSON file, with many data inside. And I want to display this with AJAX, so I tried to make this but doesn't work and after much search on internet I call your help :



$(document).ready(function () {
$.getJSON("data/liste_des_sites_des_hotspots_paris_wifi.json").done(function(){

function donnee (data) {
console.log(data)
}


})




Answer Source

AJAX doesn't work well with the file:// protocol (loading files directly from your file system). Access the page and files from a web server (localhost or otherwise).