XHR request is denoted as being cancelled although it seems to be successful [closed]

谁都会走 提交于 2019-11-29 11:58:55

问题


This is not really an issue, because the code works, but I am just curious as to why it happens.

I have the following jQuery code for an ajax post:

$.post('./add_fee_row/<?php echo $date; ?>',post, function(data){ ... });

It all works fine and dandy.

However in the Chrome Console it says:

Why does it say cancelled?

Everything happened as if the post was successful. Why does it say that?

(the php server code is available if needed)

I am using Google Chrome version: 17.0.942.0


回答1:


There was a bug in Chrome DevTools, it is already fixed: http://code.google.com/p/chromium/issues/detail?id=104920




回答2:


it may happen when Chrome sees that the actual data doesn’t match the headers.

If you return your answer with header type added, it shouldnt say canceled (Content-type: text/plain. for example)

You can check them by looking Event tabs - response headers.



来源:https://stackoverflow.com/questions/8302579/xhr-request-is-denoted-as-being-cancelled-although-it-seems-to-be-successful

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!