JQuery $ .getJSON carregar arquivo JSON local não está funcionando
Meu problema é muito simples, eu tenho um arquivo com o nome de new.json e estou tentando usar o JQuery para carregar e exibir os dados. Eu tenho escrito o código 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);
});
});
}
e os dados em new.json são como abaixo:
{"streetCity":
{
"1":"Abergement-Clemenciat",
"2":"Abergement-de-Varey",
"3":"Amareins"
}
};