为什么没有要更新的应用程序缓存?

时间:2014-11-15 17:00:18

标签: javascript google-chrome application-cache

我正在研究Javascript for Web Developers的第23章。为什么要运行

applicationCache.update() 
来自Chrome控制台的

返回

Uncaught DOMException: Failed to execute 'update' on 'ApplicationCache': there is no application cache to update. 

...

我的HTML文件

<!DOCTYPE html> <html manifest="offline.appcache">   
    <head>
        <title>Dynamic Quiz</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="main.css">   
    </head>   
    <body>
        <!-- Here is the question and its possible answers -->
        <div class="questionEntire">
            <h3 class="questionTitle">Question title goes here</h3>
            <form>
                <button type="submit">Next</button>
                <div class="choices">
                    <!-- <input type="radio" name="answer" value="0"><span>Choice 1</span><br> -->
                    <!-- <input type="radio" name="answer" value="1"><span>Choice 2</span><br> -->
                    <!-- <input type="radio" name="answer" value="2"><span>Choice 3</span><br> -->
                    <!-- <input type="radio" name="answer" value="3"><span>Choice 4</span><br> -->
                </div>
            </form> 
        </div>
        <!-- This is the div that should be shown at the end -->
        <div class="totalDiv hideThis">
            <h3 class="total">Your Score is</h3>
            <p>total</p>
        </div>
        <script src="https://code.jquery.com/jquery-2.1.1.js"></script>
        <script src="eventUtilities.js"></script>
        <script src="main.js"></script>
    </body>
</html>

我的offline.appcache文件

CACHE MANIFEST
#Comment

CACHE: 
https://code.jquery.com/jquery-2.1.1.js main.js
main.js 

NETWORK:
*

我无法在资源 - >应用程序缓存下的Chrome网络开发工具中看到任何文件。当我运行applicationCache.status时,总是返回0。

http://jsfiddle.net/michaellatch/uxtawuwv/

提前谢谢!

0 个答案:

没有答案