Debugging Jquery ajax function

后端 未结 3 786
鱼传尺愫
鱼传尺愫 2021-02-08 08:59

JS code:

$.ajax({


        type: \'POST\',
         url: \'http://localhost/MyServiceDir/Service.asmx/Foo\',
         contentType: \'application/json; charset=u         


        
3条回答
  •  不思量自难忘°
    2021-02-08 09:33

    The "status" parameter only includes why it failed -- timeout, error, etc... To get the status code you need to check the response object: xhr.status

    See http://www.w3.org/TR/XMLHttpRequest/#response for details.

    If you are getting "500 Internal Server Error" that is all you are going to get from ajax. You will have to check your application or server logs. This could be a syntax error or or library error or something else along those lines.

提交回复
热议问题