Aufruf einer ajax-Funktion innerhalb einer Funktion (jQuery)

    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);
}

ist wieder in "- test nicht definiert ist".
Wie man dieses Problem lösen? Ich habe bereits versucht, async: false.

Dank

InformationsquelleAutor Chris | 2012-05-31
Schreibe einen Kommentar