Why is AJAX returning HTTP status code 0?

后端 未结 20 3183
野的像风
野的像风 2020-11-22 06:39

For some reason, while using AJAX (with my dashcode developed application) the browser just stops uploading and returns status codes of 0. Why does this happen?

20条回答
  •  被撕碎了的回忆
    2020-11-22 07:22

    We had similar problem - status code 0 on jquery ajax call - and it took us whole day to diagnose it. Since no one had mentioned this reason yet, I thought I'll share.

    In our case the problem was HTTP server crash. Some bug in PHP was blowing Apache, so on client end it looked like this:

    mirek@toccata:~$ telnet our.server.com 80
    Trying 180.153.xxx.xxx...
    Connected to our.server.com.
    Escape character is '^]'.
    GET /test.php HTTP/1.0
    Host: our.server.com
    
    Connection closed by foreign host.
    mirek@toccata:~$ 
    

    where test.php contained the crashing code. No data returned from the server (not even headers) => ajax call was aborted with status 0.

提交回复
热议问题