Wie debugge ich ein jQuery-Ajax-request?

Mein code ist:

var test = "it isn't working";
var response = $.ajax({
    type: 'GET',
    url: 'jquerydemo.php', //This is in the same site as the page calling this request, so it's not a same-domain error.
    success: function(){
            test = "it's working";
        },
    error: function(){
            alert("Error detected");
        }
 }).responseText;
alert(test);

Getestet habe ich den status-code und es kam zu einem 200-und die error-Funktion geht nie aus, aber das macht auch den Erfolg der Funktion. Wie ich schon sagte in meinem Kommentar, es ist nicht ein same-origin-policy-Fehler. Es bleibt nur zu sagen "es funktioniert nicht". Was ist denn hier Los?

InformationsquelleAutor needhelpwithsumajax | 2011-08-09

Schreibe einen Kommentar