I was thinking about how to implement an "online-update" system for my Phonegap / Cordova app, and at least as far as Javascript is concerned the easiest way I could think of was to store the main script in LocalStorage, check for updates via version number, and then just eval
ing the script.
That is to say, when the application starts it eval's the version of the script stored in a LocalStorage entry. Then on login, in addition to authentication information it will receive from the server a version-number, which it will check against its current version number. If they do not match, it will pull the new version of the script from the server, store it in LocalStorage, and restart.
The main benefits to doing it this way are that it is (a) simple and (b) platform independent. The main drawback is that only the script can be updated, and HTML / CSS remains static (but can be overridden by JS in a pinch). Is there any glaring reason why this would not work? Does this seem like a reasonable way of going about this, or is there a better / more accepted way to push updates without visiting the app store?