在for loop
中的console.log
在工作,但在外面的undefinded
:
var counter;
$.get( "https://api.123.json", function( data123 ) {
console.log("Ilość danych: " + data123.feeds.length);
console.log(data123.feeds[15].field4);
for (var i = 0; i < data123.feeds.length; i++) {
counter = data123.feeds[i].field4;
console.log(counter);
}
});
console.log("Poza jquery: " + counter);