Hello!
I'm trying to create a managedStore to cache all the js, img, swf and css from a web app I'm developing.
Here is the code:
$(document).ready(function() {
var manifestName = 'cache_manifest.json';
var storeName = 'cache';
var localServer;
var localStore;
if (window.google && google.gears) {
localRequest = google.gears.factory.create('beta.httprequest');
localServer = google.gears.factory.create('beta.localserver');
localStore = localServer.openManagedStore(storeName);
isServerAvailable();
$("#separator").text(' | ');
if (!localStore) {
localStore = localServer.createManagedStore(storeName);
localStore.manifestUrl = manifestName;
localStore.onerror = $('#offline').text('Error con el cache');
localStore.oncomplete = $('#offline').text('Cache activado');
localStore.onprogress = $('#offline').text(Math.ceil(((event.filesComplete / event.filesTotal) * 100)) + "%");
localStore.checkForUpdate();
}
else {
$('#offline').text('Cache activado');
}
}
});
However, localStore.onerror always get's triggered.
I have to questions:
- Any ideas what's going wrong?
- How can I see what's the actual error ( alert(localStore.onerror) won't work)
Regards,