Help to understand, please. Cannot use result of ajax request.
$.ajax({ async: true, type: "POST", url: "/ajax_que.php", dataType: "json", success: function(data_db) { var answer = data_db; console.log(data_db); for(var i = 0; i < answer.length; i++){ console.log(answer[i]); } }, complete: function draw(){} }); Actually, if I use a loop inside ajax
for(var i = 0; i < answer.length; i++){ console.log(answer[i]); } That's all ok.
But I need to work with answer (this is an associative array) inside the draw function.