Arseniy Sokolovsky2021-08-03 13:54:53
Arseniy Sokolovsky, 2021-08-03 13:54:53

Ajax request is executed but fails?

I have an ajax request

            url: localDancerweek,
            type: "POST",
            headers: {
                "mapname": songCodename,
                "type": "write",
                "nickname": "",
                "avatar": "",
                "score": ""
            dataType: "json"
        }).done(function()  {
        }).fail(function(xhr, status, error)  {
            alert("Sorry. Server unavailable. " );
            alert( [ xhr.status, status, error ] );

On successful request, a json file is created

Well and so, at request, the file that is created. But for some reason it responds with fail, not done. The request seems to be successful. What could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Ildar V, 2021-08-12

What form should the response take? Maybe you need to apply dataType to text, for example?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question