jQuery doesn't seem to parse JSON automatically
jquery, json, parsing, string
Solution
The parameter is actually `dataType`, not `datatype` (JavaScript is case sensitive).
You can try with:
dataType: 'json' // not datatype
within your `ajaxSetup`;
Problem
Here's my client-side jQuery code: ``` $.ajaxSetup ({ contentType: "application/json", datatype: 'json' }); $.ajax({ type: "POST", url: "http://localhost:1234/path", data: JSON.stringify(myData), success: function(aString){ alert(aString); }, error: function(errorData){ alert(errorData); } }); ``` Here is the data the server sends out: ``` 200 Content-Type: application/json "aStringsData" ``` In the alert the quotes of "aStringData" are displayed. However, I'd expect the quotes to be taken away due to the automatic JSON.parse I expect to happen from datatype: 'json'. Am I wrong on this?