From da4bb9724ffec4d499a82263d1ce47c5eabf4ec2 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <set117@yahoo.com>
Date: Tue, 30 Aug 2011 12:13:20 -0700
Subject: [PATCH] A bit of cleanup, if no error message in IE, say so.

---
 rp/index.html | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/rp/index.html b/rp/index.html
index 53fd47c1e..06b071670 100644
--- a/rp/index.html
+++ b/rp/index.html
@@ -81,11 +81,12 @@ a:hover { border-bottom: 2px solid black ; }
 <script src="jquery-min.js"></script>
 <script src="https://browserid.org/include.js"></script>
 <script>
-  $(document).ready(function() {
-    $("#partyStarter").click(function() {
+  $(function() {
+    $("#partyStarter").click(function(event) {
+      event.preventDefault();
       navigator.id.getVerifiedEmail(function(assertion) {
         if (!assertion) {
-          alert("couldn't get the users email address!"); 
+          alert("couldn't get the users email address!");
         } else {
           // Now we'll send this assertion over to the verification server for validation
           $("#oAssertion").empty().text(assertion);
@@ -100,14 +101,17 @@ a:hover { border-bottom: 2px solid black ; }
 
           $.ajax({
             url: "https://browserid.org/verify",
-            type: "POST",
+            type: "post",
             dataType: "json",
             data: data,
             success: function(data, textStatus, jqXHR) {
               $("#oVerificationResponse > pre").empty().text(JSON.stringify(data, null, 4));
             },
             error: function(jqXHR, textStatus, errorThrown) {
-              $("#oVerificationResponse > pre").empty().text(JSON.stringify(JSON.parse(jqXHR.responseText), null, 4));
+              var statusEl = $("#oVerificationResponse > pre").empty();
+              var resp = jqXHR.responseText ?
+                JSON.stringify(JSON.parse(jqXHR.responseText), null, 4) : errorThrown;
+              statusEl.text(resp);
             }
           });
         }
-- 
GitLab