JQuery $ .getJSON ładuje lokalny plik JSON nie działa
Mój problem jest bardzo prosty, mam plik o nazwie new.json i próbuję użyć JQuery do załadowania i wyświetlenia danych. Pisałem kod JavaScript:
$.getJSON("new.json", function(data){
// I have placed alert here previously and realized it doesn't go into here
$.each(data.streetCity, function(i,s){
alert(s);
});
});
}
a dane w new.json wyglądają jak poniżej:
{"streetCity":
{
"1":"Abergement-Clemenciat",
"2":"Abergement-de-Varey",
"3":"Amareins"
}
};