0
I cannot copy the result to the variable registroJson
, I’ve already lost almost a day in this trouble:
$(document).ready(function(){
var registroJson = [];
var url = 'xpto';
$.getJSON(url,function(data){
registroJson = data; //copiando para variavel registroJson o resutado 'data'
// já tentei registroJson.push(data) e tabem não funciona
});
console.log(registroJson); //o resultado no console sempre mostra [], array vazio
});
William thank you so much!! Surely I will read and study these links you have indicated!!!
– Paulo Cesar
@If the answer solved the problem, mark it as correct, if you do not know how to do it read this link: http://meta.pt.stackoverflow.com/q/1078/3635
– Guilherme Nascimento