I was working on an iPhone web app recently (my first, actually) and came across an annoyance: any links in a web app with apple-mobile-web-app-capable set to "yes" will open in Safari, not the app itself. I wanted to keep things as simple as possible, and not have to change my code to support AJAX loading. Some research turned up this article which did almost exactly what I wanted, except I didn't want to load a page into a container. I wanted all links to Just Work how you'd expect links to work. So I dropped this bit of jQuery code into my base template, and everything seems to work great:

Read more…