Get server response with AJAX error?

前端 未结 1 561
感动是毒
感动是毒 2021-01-01 10:47

for an incorrect Ajax action, I set with HTTP header code to 403 and send the following response :

{\"code\":\"403\",\"status\":\"Forbidden\",\"message\":\"Y         


        
相关标签:
1条回答
  • 2021-01-01 11:44

    You should be getting in jQuery 'error' callback... http://api.jquery.com/jQuery.ajax/

     error: function(xhr, status, error) {
        alert(xhr.responseText);
     }
    

    (btw.. ur code?)

    0 讨论(0)
提交回复
热议问题