IndexedDB, WebSQL in 4 Months

后端 未结 3 1401
囚心锁ツ
囚心锁ツ 2021-01-11 09:44

I\'ve got a bit of a problem, I\'m about to start a 4-6 month project which will need offline support. AppCache is awesome and accepted as the standard but the big browsers

3条回答
  •  萌比男神i
    2021-01-11 10:28

    i would indeed go for (a.o.) localstorage. I wrote a small proof of concept of such an offline web-app earlier this year (cfr. this blogpost and the offline-enabled webapp here), the basic approach being;

    • put data in arrays/ objects
    • use standard javascript functions to do CRUD (or go for jlinq)
    • json-ify the array/object for storage
    • use a storage-abstraction library like persistjs to store/ retrieve json-ified array/object

提交回复
热议问题