XMLHttpRequest HTTP請求的返回碼為0 http status = 0


由於用戶在http返回前關閉/取消,或者防火牆等原因,會造成http請求沒有status信息。w3c有相應的說明:http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute

4.7.1 The status attribute

client . status

Returns the HTTP status code.

The status attribute must return the result of running these steps:

  1. If the state is UNSENT or OPENED, return 0.

  2. If the error flag is set, return 0.

  3. Return the HTTP status code.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM