【发布时间】:2014-06-17 00:36:38
【问题描述】:
当我尝试发出 jquery ajax "Type:Post" 请求时,我收到 404 not found (from cache) 错误。我已经尝试了几种解决方法来解决这个问题,但它没有奏效。这是我尝试过的解决方法:
在ajax调用中添加头信息: "Cache-Control" : "private, no-cache, no-store, must-revalidate", “过期”:“0”,
jquery ajax "cache:false"
添加 rnd URL 参数,
"?nocache=' + new Date().getTime()",试图禁用 AppCache (nativ):
"super.appView.getSettings().setAppCacheEnabled(false);"
这是我在使用开发工具调试我的 Cordova 应用程序时从这个 POST 请求中得到的响应: http://pl.vc/59s6o
【问题讨论】:
-
这听起来像是您的浏览器或服务器的问题,而不是 JQuery。
-
我将此项目开发为 Web 应用程序和 Cordova 项目。 Web 应用程序可以很好地处理我在 Cordova 项目中使用的相同请求。我已经在 chrome 和 Postman 中对其进行了测试。这个问题只出现在 Cordova 项目中
标签: jquery ajax caching cordova