Fixed link error with new post display
authorDylan Lloyd <dylan@psu.edu>
Thu, 10 Mar 2011 10:03:49 +0000 (05:03 -0500)
committerDylan Lloyd <dylan@psu.edu>
Thu, 10 Mar 2011 10:03:49 +0000 (05:03 -0500)
includes/ajax.js

index bc51be3..6946a07 100644 (file)
@@ -27,9 +27,14 @@ $(document).ready(function() {
                         url: "verify",
                         data: comment_data,
                         success: function() {
-                          var new_post = "<h3><a href='mailto:" + email
-                                          + "'>" + name + "</a></h3>"
-                                                          + text + "<br><br>";
+                          if (email != '') {
+                            var new_post = "<h3><a href='mailto:" + email
+                                            + "'>" + name + "</a></h3>"
+                                                            + text + "<br><br>";
+                          } else {
+                            var new_post = "<h3>" + name + "</h3>"
+                                                            + text + "<br><br>";
+                          }
                           $('#comments').prepend(new_post);
                           $('#comment').hide();
                           console.log('posted new comment');