title: HTML link to launch an app if installed or go to a website if not
body: <p>I have a mobile site written using jQuery Mobile and I have social icons. What I want is that if the user clicks on the Facebook icon to open the facebook app only if the user has the facebook app installed on their phone.  If the user does not have the app on the phone I need it to go to Facebook's mobile site instead.</p>
  
  <p>I am using this link to open the app: </p>
  
  <pre><code>&lt;a href="fb://profile/212971392077465" class="facebook"&gt;My Fanpage&lt;/a&gt;
  </code></pre>
  
  <p>This works, but now I need help with code to open the mobile site if the user doesn't have these apps installed.</p>
  
  <p>Ideally, this same technique should work with Twitter (I use <code>twitter://status?id=12345</code> to get to the app).</p>