function getCChatStatus() {
jQuery.ajax({
type: "POST",
url: "index.php?page=CChatAction",
data: { action: "getStatus" }
}).done(function(msg) {
var cChatStatus = jQuery.parseJSON(msg);
return cChatStatus;
});
}
function CChatOptions() {
var test = getCChatStatus();
alert(test);
}
retourne "test is undefined". Comment résoudre ce problème? J'ai déjà essayé async: false.Appel d'une fonction ajax au sein d'une fonction (jQuery)
Merci
double possible de [Valeur de retour à l'intérieur de .ajax $() fonction] (http://stackoverflow.com/questions/8187201/return-value-from-inside-of-ajax-function) – JJJ