Debugging Jquery ajax function

后端 未结 3 785
鱼传尺愫
鱼传尺愫 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:14

    Try this out in the onerror event:

    alert(xhr.statusText)
    

    EDIT:

    I think your best bet here would be to install the FireBug Plugin on Firefox. This will allow you to see the ajax calls(enable "console" tab for this), responses, and error messages. Hopefully you will be able to get the info you need in this manner. This has been always been my method of choice for debugging ajax calls

提交回复
热议问题