Html程序  |  27行  |  831 B

<html manifest="subframes-3.manifest">
<script>
function test()
{
    applicationCache.onnoupdate = null;

    try {
        var req = new XMLHttpRequest;
        req.open("GET", "simple.txt", false);
        req.send(null);
        alert("FAIL, unexpected response: " + req.responseText);
    } catch (ex) {
        // Loading should fail, because simple.txt is not in cache manifest.
        parent.postMessage("allDone", "*");
    }
}

// The cache has been fully created before the iframe was inserted, and the manifest didn't change.
applicationCache.onnoupdate = test;

applicationCache.onupdateready = function() { alert("Unexpected updateready event") }
applicationCache.oncached = function() { alert("Unexpected cached event") }
applicationCache.onerror = function() { alert("Unexpected error event") }

</script>
</html>