开发者

Is it possible to run a *completely* client-side, HTML5-based app using local storage?

开发者 https://www.devze.com 2023-03-06 20:32 出处:网络
Is it possible to run a completely HTML5-based app, using the <canvas> element, on local resources only? i.e. without the need to connect to 开发者_开发技巧a remote server to load bitmap images,

Is it possible to run a completely HTML5-based app, using the <canvas> element, on local resources only? i.e. without the need to connect to 开发者_开发技巧a remote server to load bitmap images, objects, media, etc' but instead pull them out of local storage?


In a word. Yes. But not out of local storage, if you mean the local storage name value pair alternative to session storage that is available in HTML5.

If you mean save them locally in a file structure and use them, then yes.

You need to use a manifest file to specify the required artifacts, as outlined by w3.org.

Here's a great resource http://diveintohtml5.ep.io/offline.html


You have to give to the user the resources at the beginning, on a way or the other...

If you want an app to rely just on the local data, I would suggest a "packaged app" for Chrome, so the user downloads it once and the use it locally.

http://code.google.com/chrome/extensions/apps.html

Otherwise with the HTML5 "manifest" you can ask the app to keep the once downloaded file available even when offline.

0

精彩评论

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

关注公众号