加入.appcache停止jQuery的Ajax调用缓存文件 [英] adding cache file .appcache stops jquery ajax call
问题描述
我已经发表在蔚蓝的一个网站上,usues jQuery的AJAX调用来获取数据从蔚蓝的托管数据库。 现在我的问题是这样的流程工作正常,除非我把它添加.appcache文件缓存在本地的文件,以便网站可以脱机工作为好。将这个文件将停止工作,并显示我像一个错误后,
I have published a website on azure which usues jquery ajax calls to fetch the data from azure hosted database. Now my question is this flow is working fine unless and until i add ".appcache" file in it for caching the files locally so that the website can work offline as well. After adding this file it stops working and shows me an error like
net::ERR_FAILED $jquery-1.11.2.js:9659
send $jquery-1.11.2.js:9659
jQuery.extend.ajax $jquery-1.11.2.js:9210
loginservice $authentication.js:94
(anonymous function) $authentication.js:81
点击jQuery的-1.11.2.js:9659
重定向我此行的的jQuery
:
clicking on "jquery-1.11.2.js:9659"
redirects me to this line in jquery
:
xhr.send((options.hasContent&安培;&安培; options.data)|| NULL);
可以请人指导我如何工作的吗?如何使用缓存和jQuery在一起吗?
can somebody please guide me how does this works? how can use caching and jquery together?
推荐答案
我想象你正在尝试通过jQuery访问的网址是不是一个被列入缓存
缓存清单的部分。请记住,在使用appcache,所有的请求从缓存,而不是服务器的负载。如果资源没有缓存,您将获得净:: ERR_FAILED。
I imagine that the url you are trying to access via jQuery is not one that is listed in the CACHE
section of your cache manifest. Remember that, when using appcache, all requests load from the cache and not the server. If a resource isn't cached, you'll get net::ERR_FAILED.
一个例外是在网络中列出的文件
部分资源。尝试添加以下到您的缓存清单:
The one exception is for resources listed in the NETWORK
section of the file. Try adding the following to your cache manifest:
NETWORK:
*
再试一次,看看错误自行解决。
Try again, and see if the error resolves itself.
这篇关于加入.appcache停止jQuery的Ajax调用缓存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!