Assuming a client with offline support, my assumption is to do the
following on EVERY page of the application?

// Check for gears of course
if (!window.google || !google.gears) {
        location.href = "http://gears.google.com/?
action=install&message=<your welcome message>&return=<your website
url>";
}

// Initialize local server and check for manifest update
var localServer = google.gears.factory.create('beta.localserver');
var store = localServer.createManagedStore('myManagedStoreName');
store.manifestUrl = 'myManifestFileName.json';
store.checkForUpdate();

// Optionally initialize DB if needed on per page basis
var db = google.gears.factory.create('beta.database');
db.open('myDatabaseName');
// do db stuff
rs.close();

Is this correct? The documentation seems pretty thorough, but wasn't
sure what's a one-time thing and what needs to be addressed on every
page session. This is my first attempt at an offline client so I'm not
used to dealing with persistence without pulling from the server ;)

Reply via email to