缓存清单页面中的AJAX问题 [英] Problems with AJAX in Cache Manifest Page

查看:58
本文介绍了缓存清单页面中的AJAX问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个实现缓存清单的页面,因此可以离线加载。



此页面还执行一个脚本,该脚本将AJAX请求发送到原始页面来自同一服务器/域。



在第一页上加载,当从服务器加载,AJAX按预期工作。



但是当从清单加载页面时,AJAX请求失败。



在chrome中我得到网络错误101和http状态为0



在IE 10中我得到指定资源的下载失败,网络错误0x2系统找不到指定的文件。 -2146697208



关于允许此页面使用AJAX访问服务器资源,我是否缺少一些技巧?



PS我使用Fiddler来监控HTTP流量,当它失败时,浏览器似乎都没有发送请求。



亲切的问候,



史蒂夫

Hi,

I have a page which implements a cache manifest so it can be loaded offline.

This page also executes a script which sends an AJAX request to the same server/domain the original page came from.

On the first page the load, when loading from the server, the AJAX works as expected.

But when the page is loaded from the manifest the AJAX request fails.

In chrome I get network error 101 and a http status of 0

In IE 10 I get the download of the specified resource has failed, Network Error 0x2 The system cannot find the file specified. -2146697208

Is there a trick I'm missing in regards to allowing this page to access server resources using AJAX?

P.S. I've used Fiddler to monitor HTTP traffic and neither browser appear to be sending the request when it fails.

Kind Regards,

Steve

推荐答案

我遇到了同样的问题并且没弄清楚,这可能与AppCache有关。感谢这篇文章,我设法找到了解决方案:我的app.cachemanifest文件只包含CACHE:部分,因此对该部分未列出的资源的任何请求都会因愚蠢的错误消息而失败。一旦我添加了

I've encountered same problem and didn't figure out, that could be related to AppCache. Thanks to this post I've managed to find solution: my app.cachemanifest file contained only "CACHE:" section, so any request to resource that is not listed in that section failed with stupid error message. Once I've added
NETWORK:
*



到缓存清单文件问题就消失了!

抱歉英文不好。


这篇关于缓存清单页面中的AJAX问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆