An old and forgotten RFC provides a way to create applications for the iPhone that people can save and execute locally, even when offline!

Back in November, I wrote about how you can store whole images inside of a URL using the RFC 2397 “data” URL format. Using this scheme on supported browsers, you can embed images within an HTML document, and you can even embed an entire HTML document within a single link.

W. Clawpaws discovered today that the iPhone’s web browser supports data URLs. This is particularly cool, because it provides a way to write and store little utlity applications entirely on the device. This is different from cached data, since the entire application is ebmedded inside the URL, tucked safely in your iPhone’s bookmark storage. You’ll be able to use these sorts of applications even when the phone has no connection or its network stack is completely disabled, like when you’re on an airplane or in Vermont.

Here’s a little javascript-based tip calculator he created as an example: Link

There’s an upper bound to how much data is allowed inside a URL on the iPhone browser. That said, there is probably a large class of utility applications that can be created this way. Remember, you can store images in a data URL as well, which you can further embed in an encoded HTML document. Provided you keep things small enough in size, you can make a whole range of micro interactive iPhone apps that are stored locally on the device.

References:
Storing iPhone apps locally with data URLs – Link
RFC 2397 – Embed image data inside a URL – Link
Online HTML/JPG/GIF to Data URI converter – Link