ancora una questione valida oggi. Nel mio esempio, il mio log degli errori non restituisce nulla. Sto usando IE11.
<html xmlns="http://www.w3.org/1999/xhtml" manifest="icozum.appcache">
onChecking eventi incendi ma poi onError con lo stato di cache = 0 che è nocached.
window.applicationCache.onchecking = function (e) {
var doc = document.getElementById("cachestatus");
if (doc != null) {
doc.innerHTML += "Checking the cache.\n";
}
}
Poi onError
window.applicationCache.onerror = function (e) {
var doc = document.getElementById("cachestatus");
if (doc != null) {
doc.innerHTML += "Cache error occurred." + applicationCache.status.toString() + "\n";
console.log(e);
console.log("test");
}
}
I dati visualizzati sullo schermo è
Controllo della cache. errore Cache occurred.0
Non c'è nessun dettaglio informazioni sull'errore nel gestore di eventi onError. Ho ottenuto il vero errore premendo F12. Ecco la schermata. C'è un modo per catturare questi dettagli nel gestore di eventi onError.
E finalmente ho capito il problema. L'errore non è dovuto alla mancanza del file. Il file di cache dell'app esiste, tuttavia in Windows, Visual Studio (2013)/IIS non riconosce l'estensione .appcache
. La seguente sezione deve essere aggiunta al file web.config
.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".appcache" mimeType="text/cache-manifest"/>
</staticContent>
</system.webServer>
fonte
2015-08-08 03:40:34