1

Sometimes I need to write a small program just to represent some data in a chart, or similar stuff. I have been wanting to do this kind of things through the browser, with HTML5. I think it would be nice to use its canvas to create a nice UI for simple apps.

I have read some articles related to offline applications with HTML5, but they focus on downloading all the data you need and save it to the cache to use it offline later. You even need to set up an Apache server (or similar) to create your app.

I don't need my app to be online, just in my computer. I just want to create a simple application, nothing to do with internet at all.

How can I do this? Is it even possible or worthy? Is there any "Hello world!" tutorial about this around there?

2
  • 1
    Can't you zip the folder containing html and javascript and distribute it? You can also make an installer for it if you want. Commented Jul 11, 2012 at 15:01
  • I guess I can: it is exactly what I'm looking for. But I have no idea of how to do it. That's why I'm asking for a "Hello world" tutorial Commented Jul 11, 2012 at 15:12

2 Answers 2

2

Something like Mozilla Prism would be good for displaying the content as an application.

There's no need to have a web server like Apache for just displaying HTML5/Javascript in a browser. You can just have it all in a folder on your desktop and then load it in the browser with the file:// protocol.

For example file://C:/Documents and Settings/YourUser/Desktop/YourApp/index.html would open an HTML file in a folder called YourApp on your user's desktop.

Sign up to request clarification or add additional context in comments.

4 Comments

@RomanRdgz Mozilla has now re-branded Prism as Chromeless: developer.mozilla.org/en/Chromeless . You would distribute Prism along with your HTML files, which is not a big deal as it has support for Windows, Mac, and Linux.
Looks fine, but Prism no longer exists. Neither do its sons, Chromeless and WebRunner.
mozillalabs.com/en-US/chromeless There says it is considered an inactive project
@RomanRdgz Look at this wiki.mozilla.org/Prism and this blog.mozilla.org/labs/2011/02/prism-is-now-chromeless . Inactive just means it hasn't been developed recently, which is because the HTML5 spec is still not finalized.
0

If you ever find you need to read static HTML+Javascript files locally then I'd recommend using this python command in the console:

python -m SimpleHTTPServer

It launches a simple HTTP server (who'd of guessed) that serves files from the current working directory. Effectively, it's the same as launching an apache webserver, putting some static assets in /var/www/... etc. etc.

You could also just browse to the assets at file:///some/folder; however, most browsers will prevent javascript from using AJAX when files are loaded in that way, which will manifest as a bunch of bugs when you go to load it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.