Why is jqXHR.responseText returning a string instead of a JSON object?

后端 未结 5 529
鱼传尺愫
鱼传尺愫 2020-12-24 12:33

I have an $.ajax() request with the dataType set to \"json.\" The server is returning JSON with the correct mime type of \"application/json.\" And yet the responseText in my

5条回答
  •  无人及你
    2020-12-24 13:18

    Try

    $.ajaxSetup({
        "error": function(jqXHR, status, thrownError) {
            alert('error');            
            console.log(jqXHR.responseJSON);
        }
    });
    

提交回复
热议问题