title: How can I interpret JSON returned from jQuery.ajax and using a POST action?
body: <p>I have the following jQuery code:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "Services/MyService.asmx/Select",
      dataType: "json",
      data: "{'data':'test'}",
      contentType: "application/json; charset=utf-8",
      success: function(msg){ 
                  alert(msg); 
               },
      error: function(xhr){ alert(xhr.statusText);}                
  });
  </code></pre>
  
  <p>The call to the method returns the following:</p>
  
  <pre><code>"{"FirstName":"James"}"
  </code></pre>
  
  <p>When I get the value back, my alert returns the full json string.  If I try to do <code>alert(msg.FirstName)</code>, I get "undefined".</p>
  
  <p>I have seen a lot of examples using the getJSON() method; however, I haven't seen a way to use that for a POST verb.  Can anyone point me in the right direction where I'm going wrong?  Based on the jquery documentation, the return value should be the same dataType (json) so I'm not certain what I'm missing.</p>
  
  <p>EDIT:
  I looked on my service and it is matching examples that I'm finding in terms of the method signature returning a string.  I've also confirmed the response type is of application/json.</p>
  
  <p>EDIT2:
  Updated the response to include the outside quotes.  I'm also using a custom JavaScriptConverter to do the JSON serialization.  The custom converter just takes my object properties (in this case FirstName) and loads it and it's value into a Dictionary collection which the ASP.Net AJAX Extensions v1.0 can serialize easily.</p>
  
  <p>EDIT3:
  Looking into the issue that I was having with eval() (it caused an <code>Expected ";"</code> error), I noticed that the json property names were also enclosed in quotes.  Once I removed the quotes from the property name (not the value), eval() worked again.  Looking into the server side of this issue now.</p>