Skip to Main Content
Professional iPhone™ and iPod® touch Programming: Building Applications for Mobile Safari™
book

Professional iPhone™ and iPod® touch Programming: Building Applications for Mobile Safari™

by Richard Wagner
January 2008
Beginner to intermediate content levelBeginner to intermediate
307 pages
6h 49m
English
Wrox
Content preview from Professional iPhone™ and iPod® touch Programming: Building Applications for Mobile Safari™

Chapter 10. Packaging Apps as Bookmarks: Bookmarklets and Data URLs

Because iPhone and iPod touch applications function inside of the Mobile Safari environment, there are two seemingly obvious restrictions for the Web developer: You must live with the built-in capabilities of the Mobile Safari browser; and you need a constant Wi-Fi (or, for iPhone, EDGE) connection in order to run any application.

The truth is that you can get around these limitations by taking advantage of two lesser-known technologies — bookmarklets and data URLs. These technologies have actually been around for years, but they have tended to exist on the periphery of mainstream Web development. However, developers are now reexamining these two developer tools to maximize the potential of the iPhone application platform.

Bookmarklets (short for bookmark applets) are mini JavaScript "applets" that can be stored as a bookmark inside of Safari. A data URL is a technique for storing an entire Web page or application (pages, styles, images, data, and scripts) inside of a single URL, which can then be saved as an iPhone/iPod touch Bookmark. This application-in-a-bookmark can then be accessed in offline mode.

Bookmarklets

A bookmarklet is JavaScript stored as a URL and saved as a bookmark in the browser. It is typically used as a one-click applet that performs a very specific task or performs an action on the current Web page. A bookmarklet uses the javascript: protocol followed by script code. For instance, here's the simplest ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The iPhone™ Developer’s Cookbook: Building Applications with the iPhone 3.0 SDK, Second Edition

The iPhone™ Developer’s Cookbook: Building Applications with the iPhone 3.0 SDK, Second Edition

Erica Sadun
Release 2.0: Issue 3

Release 2.0: Issue 3

Jimmy Guterman

Publisher Resources

ISBN: 9780470251553Purchase book