I do an AJAX where I get a JSON object (questions) :
function questionnaire()
{
$.ajax({
type: "POST",
dataType: "json",
url: "/configuration/nacellesquestionnaire",
success: function(questions)
{
displayQuest(questions);
return questions;
},
error: function()
{
return false;
}
});
}
So , with the return questions
, I want to put this JSON object in an Array :
$(document).ready(function()
{
var questBackup;
questBackup = questionnaire();
});
The problem : When I check the array questBackup
with a console.log(), there are an "undefined" ...
Note : when I do console.log(question)
in success AJAX I have the correct JSON object.