脱机Web应用程序不能在Firefox上缓存,但在Chrome上可以 [英] Offline Web App not caching on Firefox but ok on Chrome

查看:208
本文介绍了脱机Web应用程序不能在Firefox上缓存,但在Chrome上可以的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:


大家好,我试图创建一个离线的网络应用程序,我曾经能够做到这一点。但是,自从上一次更改需要.appcache extesion时,我不能在Firefox上使用清单文件。我在Chrome上测试了相同的文件,它似乎运行完美....

这里是我的index.html

 <!DOCTYPE html> 
< html manifest =manifest.appcache>
< head>
< meta http-equiv =Content-Languagecontent =pt-br>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8/>
< title>无标题1< / title>

< script type =text / javascript>


var cacheStatusValues = [];
cacheStatusValues [0] ='uncached';
cacheStatusValues [1] ='空闲';
cacheStatusValues [2] ='检查';
cacheStatusValues [3] ='下载';
cacheStatusValues [4] ='updateready';
cacheStatusValues [5] ='废弃';

var cache = window.applicationCache;

cache.addEventListener('cached',logEvent,false);
cache.addEventListener('checking',logEvent,false);
cache.addEventListener('下载',logEvent,false);
cache.addEventListener('error',logEvent,false);
cache.addEventListener('noupdate',logEvent,false);
cache.addEventListener('obsolete',logEvent,false);
cache.addEventListener('progress',logEvent,false);
cache.addEventListener('updateready',logEvent,false);

函数logEvent(e){

alert(tipo:+ e.type);


$ b函数clica_update(){

alert(update:+ cache + - + cache.status);

/ *
尝试{

cache.update();

} catch(e){

alert(erro:+ e);

}
* /

};

alert(FIM);

< / script>

< / head>

< body>

< p> Teste< / p>
< p>& nbsp;< / p>
< p>

< button name =botaoonclick =clica_update();>按钮< /按钮>

< / p>

< / body>
< / html>

这里是我的清单



<$ p $ CACHE MANIFEST
#rev:2
*



<当我点击按钮它说缓存状态等于0(未缓存)。有没有人知道它可能是错误的?

顺便说一句,任何人都知道任何网站与工作清单,因为我似乎没有在网上找到任何。 p>

ps:我在firefox上查了一下about:config好像还好...

解决方案

HTML 5 Appcache在safari / opera / chrome中工作,但不是Firefox
$ b


查看服务器是否设置no-cache / no为生成的文件存储标题。然后,Firefox将忽略与其他浏览器相反的清单。



Possible Duplicate:
HTML 5 Appcache works in safari/opera/chrome but not firefox

Hi everyone i was trying to create a offline web app and i Used to be able to do it. But since the last changes when the .appcache extesion was required I am not beeing able to use the manifest file on Firefox. I tested the same file on Chrome and it seems to be running perfect....

Here goes my index.html

<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
    <meta http-equiv="Content-Language" content="pt-br">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled 1</title>

<script type="text/javascript">


    var cacheStatusValues = [];
    cacheStatusValues[0] = 'uncached';
    cacheStatusValues[1] = 'idle';
    cacheStatusValues[2] = 'checking';
    cacheStatusValues[3] = 'downloading';
    cacheStatusValues[4] = 'updateready';
    cacheStatusValues[5] = 'obsolete';

    var cache = window.applicationCache;

    cache.addEventListener('cached', logEvent, false);
    cache.addEventListener('checking', logEvent, false);
    cache.addEventListener('downloading', logEvent, false);
    cache.addEventListener('error', logEvent, false);
    cache.addEventListener('noupdate', logEvent, false);
    cache.addEventListener('obsolete', logEvent, false);
    cache.addEventListener('progress', logEvent, false);
    cache.addEventListener('updateready', logEvent, false); 

    function logEvent(e) {

        alert("tipo: "+e.type);

     }

     function clica_update(){

        alert("update: "+cache+" - "+cache.status);

        /*
        try{

            cache.update();

        }catch(e){

            alert("erro: "+e);

        }
        */

     };

     alert("FIM");

</script>

</head>

<body>

<p>Teste</p>
<p>&nbsp;</p>
    <p>

<button name="botao" onclick="clica_update();">button</button>

    </p>

</body>
    </html>

And here goes my manifest

CACHE MANIFEST
# rev: 2
*

When I hit the button it says the cache status is equal to 0 (uncached). Does anyone knows what it might be wrong?

By the way does anyone knows any website with a working manifest as i seem to do not find any in the web.

Ps: I checked the about:config on firefox and it seems to be ok...

解决方案

HTML 5 Appcache works in safari/opera/chrome but not firefox

Look if the Server sets no-cache/no-store headers for the generated files. Firefox will then ignore the manifest in contrary to the other browsers.

这篇关于脱机Web应用程序不能在Firefox上缓存,但在Chrome上可以的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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