开发者

File, Save As for iPhone and Android

开发者 https://www.devze.com 2023-04-11 10:10 出处:网络
I have an application written in HTML5 that uses localstorage.The user should be able to play this game in airplane mode, but right now it goes to my website to load the page.

I have an application written in HTML5 that uses localstorage. The user should be able to play this game in airplane mode, but right now it goes to my website to load the page.

Q: How do I save a web page onto a mobile device so that it doesn't require going to the Internet to dl it first?

Is the answer 开发者_如何学Cdifferent for iPhone vs. Android?


You would use a mixture of DOMApplicationCache and html5 web storage.

DOMApplicationCache is for storing files, like images and JS files. Info can be found here

web storage, in form of LocalStorage and SessionStorage, is for storing key/value pairs. That is pure data. There is also WebSQL that is like SQLite.

info on LocalStorage and session storage here

Note that there are file-size limits, which vary on Android and iOS devices.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号