什么会导致页面被取消?我有一个Chrome开发者工具的截图。

这种情况经常发生,但不是每次都发生。似乎一旦缓存了一些其他资源,页面刷新就会加载LeftPane.aspx。真正奇怪的是,这只发生在谷歌Chrome浏览器中,而不是ie8。知道为什么Chrome会取消一个请求吗?


当前回答

I had the same issue when updating a record. Inside the save() i was prepping the rawdata taken from the form to match the database format (doing a lot of mapping of enums values, etc), and this intermittently cancels the put request. i resolved it by taking out the data prepping from the save() and creating a dedicated dataPrep() method out of it. I turned this dataPrep into async and await all the memory intensive data conversion. I then return the prepped data to the save() method that i could use in the http put client. I made sure i await on dataPrep() before calling the put method:

等待dataToUpdate =等待dataPrep(); http。把(apiUrl dataToUpdate);

这解决了间歇性取消请求的问题。

其他回答

请求可能已经被跟踪保护插件阻止了。

我有两个CSS文件,它们存储在我的主CSS文件夹之外的另一个文件夹中。我正在使用表达式引擎,发现问题是在我的htaccess文件中的规则。我只是将文件夹添加到我的条件之一,它修复了它。这里有一个例子:

RewriteCond %{REQUEST_URI} !(images|css|js|new_folder|favicon.ico)

因此,检查htaccess文件是否存在潜在冲突是值得的

对于我的案例,我有一个锚与点击事件像

<a href="" onclick="somemethod($index, hour, $event)">

里面点击事件我有一些网络呼叫,Chrome取消请求。锚有href与""意味着,它重新加载页面,同时它有点击事件与网络调用被取消。每当我用void替换href时

<a href="javascript:void(0)" onclick="somemethod($index, hour, $event)">

问题消失了!

在我的情况下,它开始出现后chrome 76更新。

由于一些问题在我的JS代码,窗口。位置被多次更新,导致取消先前的请求。 虽然这个问题之前就存在,但chrome在更新到版本76后开始取消请求。

当我在样式表中嵌入web字体时,我已经嵌入了所有类型的字体以及woff, woff2, ttf。最近我注意到Chrome取消请求ttf和woff时,woff2是存在的。我现在使用Chrome版本66.0.3359.181,但我不确定Chrome什么时候开始取消额外的字体类型。