Getting an array back from php using $.ajax
<p>A php script is giving this array (which has been passed through <code>json_encode()</code>)</p>

<p><code>[{name:"a1",path:"b1"},{name:"a2",path:"b2"}]</code></p>

<p>I use the following function to retrieve the array to jquery:</p>

<pre><code>$.ajax({
type: "POST",
url: "functions.php",
data: "action=" + something,
cache: false,
success: function(response) { alert(response); }
});
</code></pre>

<p>The problem is I get the array back as a string:</p>

<p><code>(new String("[{name:"a1",path:"b1"},{name:"a2",path:"b2"}}]"))</code></p>

<p>How can I get it to be a javascript array?</p>

<p>Help would be much appreciated.</p>
