in Jquery, how can I alert one part of a JSON object? I get "undefined"
<p>I have a an array: </p>

<pre><code>$result = array('statusAlert' =&gt; 'Your input was validated'
                 'input' =&gt; $input); // $input is a string

json_encode($result);
</code></pre>

<p>in jQuery, I want to alert 'statusAlert' and 'input' separately? How do I access them?</p>

<p>I tried <code>alert(result.statusAlert)</code>, <code>alert(result[0])</code>, <code>alert(result.statusAlert[0])</code> but none of them has worked. Thanks for your help. Regards.</p>

<p>EDIT: I am trying to do that within the "success" callback function of <code>ajax()</code> in jQuery</p>

<p>When I alert(result), I get:</p>

<pre><code>{"statusAlert":"Your input was validated","input":"this is the string input"}
</code></pre>
