title: How do I detect, via javascript in Safari Mobile, if my iPhone application is installed?
body: <p>As you probably know, iPhone applications can register a custom URL scheme handler, ala "myapp:" and these can be used for links in a page viewed in Safari. </p>
  
  <p>I'd like to automatically launch my application from a specific page if the visitor has the app installed. If the app's not installed, I'll just show them the current mobile-optimized view of the page.</p>
  
  <p>How can I do this detection? Google searches have been fruitless. Also, to be tricky, I've tried doing something like this to no avail:</p>
  
  <pre><code>var image = new Image();
  image.onerror = function(e){
    alert("bummer");
  }
  image.onload = function(e){
    alert('success!');
  }
  image.src = 'myapp://something=meaningful';
  </code></pre>
  
  <p>Has anyone come across a way to do application detection?</p>