<html>
  <body>
    <p>Farsi Flash Cards Installation Page</p>
    <script>
      // This URL must be a full url.
      var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
      var req = navigator.mozApps.installPackage(manifestUrl);
      req.onsuccess = function() {
        alert("App Installed!");
      };
      req.onerror = function() {
        alert("Whoops, something went wrong!");
      };
    </script>
  </body>
</html>

<html>
  <body>
    <p>Farsi Flash Cards Installation Page</p>
    <p id="error_msg"></p>
    <script>
      // This URL must be a full url.
      var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
      var req = navigator.mozApps.installPackage(manifestUrl);
      req.onsuccess = function() {
        alert("App Installed!");
      };
      req.onerror = function() {
        var node = document.getElementById('error_msg');
        node.innerHTML("Error: " + this.error.name);
        alert("Whoops, something went wrong!");
      };
    </script>
  </body>
</html>

Write out actual error message to document
Write out actual error message to document