如何在Web SQL中设置离线存储模式(离线/在线)的基本切换?我知道有 javascript
window.navigator.onLine
. 我可以检查模式,然后通过一个过程......
//All GET/POST performed with AJAX
//On Startup pulldown entire accessible database into offline storage (Doesn't seem secure IMO)
//if(read) pull from offline
//if(create, update, delete and online) pull from standard db, mark changes with offline expiration flag
//if(create, update, delete and offline) perform operation on offline storage, persist with POST when next online (change flag)
我在问这些标准任务是否有任何 OOB 集成?