What does status=canceled for a resource mean in Chrome Developer Tools?

前端 未结 30 1679
温柔的废话
温柔的废话 2020-11-22 11:13

What would cause a page to be canceled? I have a screenshot of the Chrome Developer Tools.

\"Canceled

30条回答
  •  不思量自难忘°
    2020-11-22 11:35

    status=canceled may happen also on ajax requests on JavaScript events:

    
    
     
    

    The event successfully sends the request, but is is canceled then (but processed by the server). The reason is, the elements submit forms on click events, no matter if you make any ajax requests on the same click event.

    To prevent request from being cancelled, JavaScript event.preventDefault(); have to be called:

    
    

提交回复
热议问题