title: How can I parse JSON using the data parameter in JQuery?
body: <p>I am making a web application using Jersey and JQuery for client-side. 
  I have the following URL that returns a JSON string:</p>
  
  <pre><code>http://localhost:8080/messenger/webapi/messages/1
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code> {"author":"Joe","created":"2015-07-28T22:33:34.667","id":1,"message":"Hello World"}
  </code></pre>
  
  <p>when typed into the browser.</p>
  
  <p>Now I am attempting to get this data client-side using the following JQuery functions:</p>
  
  <pre><code>var rootURL = "http://localhost:8080/messenger/webapi/messages";
  
  $(function() {
  
  
  $('#btnRegister').click(function() {
      var username = $('#username').val();
      addMessage();
  });
  
  function addMessage() {
  
      var url = rootURL;
      $.ajax({
          type: 'GET',
          url: rootURL +"/1",
          dataType: "json", // data type of response
          success: (function(data) {
              var obj = jQuery.parseJSON(data);
              alert('ID: ' + obj.id);
  
          })
      });
  }
  </code></pre>
  
  <p>});</p>
  
  <p>EDIT: When the "btnRegister" is pressed nothing is displayed at all</p>
  
  <p>which just doesn't make sense to me. </p>