JSON.parse() not working on jQuery data object
<p>I get a JSON file via jQuery $.getJSON(url, function(data) { ...
and want to parse it with either</p>

<p>var obj = JSON.parse(data);</p>

<p>or</p>

<p>var obj = jQuery.parseJSON(data);</p>

<p>alert(obj.center);</p>

<p>The first line gives me "syntax error" (using IE8, should support JSON.parse), the second gives me "'center' is null or not an object".</p>

<p>This is the valid JSON file I'm using:</p>

<pre><code>{
"center":{"lat":"51.99637","lon":"13.07520"},
"locations":
[
    { "name":"a string","info":"another string" },
    ... some more here ...
]
}
</code></pre>

<p>I'm not too familiar with Javascript. What am I doing wrong?</p>

<p>If I use a simple JSON array (= just the content of locations) I get valid data with $.each.
Do I have to do something with data before I can use JSON.parse on it?</p>

<p>Thanks!</p>
