Jquery ajaxrequest xhr.status code 0, sondern den html-status-code 200

Dies ist nicht eine cross-site-request-problem wie die meisten gegoogelt Antworten auf meine Fragen aus.

Ich bin immer xhr.status 0 och xhr.statusText "error" beim Versuch, eine ajax-Anfrage mit jquery-Funktionen .Holen Sie sich und .Last. In Firebug wenn die angeforderte Seite geladen wird, die mit html-status-code-200, ich kann den text in der Antwort und der Antwort-header ok ist.

Mein code:

  function GetProjectTask(e) {
    var loader = $('#' + e + 'tasks div.loader');
    var content = $('#' + e + 'tasks div.content');
    var img = $('#' + e + 'tasks img.collapseimg');
    if (loader.html() == null || loader.html().trim() == '') {
        if (content.html() == null || content.html() == '') {
            img.attr('src', 'images/expanded.gif');
            loader.html('<img src="images/loading.gif" alt="Wait..."> Loading support tasks');
            content.load('includes/my' + e + 'tasks.php',
                function (response, status, xhr) {
                    if (status == "error") {
                        var msg = "Sorry but there was an error: ";
                        alert(msg + xhr.status + " - " + xhr.statusText);
                    }
                }
            );
            return;
        }
    }
    content.empty();
    loader.empty();
    img.attr('src', 'images/collapsed.gif');
  } 

Server: IIS-v. 7.5
Jquery: v1.6.2

Irgendwelche Ideen?

Haben Sie versucht, laden Alternative Ressourcen? Wie eine statische html-Datei zum Beispiel. Was ist der Inhalt, die Art deiner Antwort von deinem php-Datei?
Yup und yup. Der Inhalt meiner Antwortdatei ist reines html.
Versucht, zu aktualisieren, jquery auf die neueste version, obwohl ich zweifelte, dass es wichtig sein würde. Und das problem bleibt.
Sorry nicht das markup in Ihrem Dokument bu response-header ContentType - was haben Sie, wenn Sie Ihre php-Skript antwortet?
Content-type ist text/html

InformationsquelleAutor moiran | 2012-01-12

Schreibe einen Kommentar