Using JSON data in a javascript function
<p>I am returing JSON data as a response in a web service I am writing.</p>

<p>I am wondering what is the best way to consume the data, returned to a Javascript function (passed as an argument).</p>

<p>Do I:</p>

<ol>
<li>use eval()</li>
<li>use Doug Crawfords jSon parser to parse the JSON data into a Javascript object </li>
<li>simply use the returned data as an object literal</li>
</ol>

<p>BTW, I am still learning Javascript, (just started reading the Definitive Guide 2 days ago) so if my question seems a bit naive or asinine - bear with me.</p>
